Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
12d1a73793 | |||
6d6eb9944a | |||
9e3a69854f | |||
5c92c06020 |
1148
package-lock.json
generated
1148
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartpdf",
|
"name": "@pushrocks/smartpdf",
|
||||||
"version": "1.0.2",
|
"version": "1.0.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "create pdfs on the fly",
|
"description": "create pdfs on the fly",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -13,20 +13,20 @@
|
|||||||
"build": "(tsbuild)"
|
"build": "(tsbuild)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.1.8",
|
||||||
"@gitzone/tsrun": "^1.1.12",
|
"@gitzone/tsrun": "^1.2.5",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.20",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.0.9",
|
||||||
"@types/node": "^10.11.4"
|
"@types/node": "^11.13.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartfile": "^6.0.8",
|
"@pushrocks/smartfile": "^7.0.2",
|
||||||
"@pushrocks/smartnetwork": "^1.1.0",
|
"@pushrocks/smartnetwork": "^1.1.0",
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@pushrocks/smartunique": "^3.0.1",
|
"@pushrocks/smartunique": "^3.0.1",
|
||||||
"@types/express": "^4.16.0",
|
"@types/express": "^4.16.1",
|
||||||
"@types/puppeteer": "^1.9.0",
|
"@types/puppeteer": "^1.12.3",
|
||||||
"express": "^4.16.3",
|
"express": "^4.16.4",
|
||||||
"puppeteer": "^1.9.0"
|
"puppeteer": "^1.14.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ tap.test('should create a pdf from html string', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should create a pdf from website', async () => {
|
tap.test('should create a pdf from website', async () => {
|
||||||
await testSmartPdf.getPdfForWebsite('https://wikipedia.org');
|
await testSmartPdf.getPdfForWebsite('https://maintainedby.lossless.com');
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should be able to close properly', async () => {
|
tap.test('should be able to close properly', async () => {
|
||||||
|
@ -1 +1,9 @@
|
|||||||
|
// compatibility
|
||||||
|
declare global {
|
||||||
|
interface Element { }
|
||||||
|
interface Node { }
|
||||||
|
interface NodeListOf<TNode = Node> { }
|
||||||
|
}
|
||||||
|
|
||||||
|
// normal
|
||||||
export * from './smartpdf.classes.smartpdf';
|
export * from './smartpdf.classes.smartpdf';
|
||||||
|
@ -78,7 +78,10 @@ export class SmartPdf {
|
|||||||
const pdfId = plugins.smartunique.shortId();
|
const pdfId = plugins.smartunique.shortId();
|
||||||
await page.pdf({
|
await page.pdf({
|
||||||
path: plugins.path.join(paths.pdfDir, `${pdfId}.pdf`),
|
path: plugins.path.join(paths.pdfDir, `${pdfId}.pdf`),
|
||||||
format: 'A4'
|
format: 'A4',
|
||||||
|
printBackground: true,
|
||||||
|
displayHeaderFooter: false,
|
||||||
|
preferCSSPageSize: true
|
||||||
});
|
});
|
||||||
await page.close();
|
await page.close();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user