Compare commits

..

2 Commits

Author SHA1 Message Date
796aa905d2 2.0.18 2022-01-06 13:23:05 +01:00
253fb95143 fix(core): update 2022-01-06 13:23:04 +01:00
3 changed files with 9 additions and 4 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@pushrocks/smartpdf", "name": "@pushrocks/smartpdf",
"version": "2.0.17", "version": "2.0.18",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@pushrocks/smartpdf", "name": "@pushrocks/smartpdf",
"version": "2.0.17", "version": "2.0.18",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@pushrocks/smartfile": "^9.0.5", "@pushrocks/smartfile": "^9.0.5",

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartpdf", "name": "@pushrocks/smartpdf",
"version": "2.0.17", "version": "2.0.18",
"private": false, "private": false,
"description": "create pdfs on the fly", "description": "create pdfs on the fly",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@ -150,12 +150,17 @@ export class SmartPdf {
documentWidth: document.body.clientWidth, documentWidth: document.body.clientWidth,
}; };
}); });
await page.setViewport({
width: 1920,
height: documentHeight,
});
const pdfBuffer = await page.pdf({ const pdfBuffer = await page.pdf({
height: documentHeight, height: documentHeight,
width: 1920, width: 1920,
printBackground: true, printBackground: true,
displayHeaderFooter: false, displayHeaderFooter: false,
scale: 1 scale: 1,
pageRanges: '1'
}); });
await page.close(); await page.close();
return { return {