fix(core): update
This commit is contained in:
parent
d16f447048
commit
6766a3d0dc
@ -99,8 +99,16 @@ export class SmartPdf {
|
|||||||
page.emulateMedia('screen');
|
page.emulateMedia('screen');
|
||||||
const response = await page.goto(websiteUrl, { waitUntil: 'networkidle2' });
|
const response = await page.goto(websiteUrl, { waitUntil: 'networkidle2' });
|
||||||
const pdfId = plugins.smartunique.shortId();
|
const pdfId = plugins.smartunique.shortId();
|
||||||
|
const { documentHeight, documentWidth } = await page.evaluate(() => {
|
||||||
|
return {
|
||||||
|
documentHeight: document.height,
|
||||||
|
documentWidth: document.width
|
||||||
|
};
|
||||||
|
});
|
||||||
const pdfBuffer = await page.pdf({
|
const pdfBuffer = await page.pdf({
|
||||||
format: 'A4',
|
format: 'A4',
|
||||||
|
height: documentWidth,
|
||||||
|
width: documentWidth,
|
||||||
printBackground: true,
|
printBackground: true,
|
||||||
displayHeaderFooter: false,
|
displayHeaderFooter: false,
|
||||||
preferCSSPageSize: true
|
preferCSSPageSize: true
|
||||||
@ -125,6 +133,7 @@ export class SmartPdf {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
const pdfBuffer = await page.pdf({
|
const pdfBuffer = await page.pdf({
|
||||||
|
format: 'A4',
|
||||||
height: documentWidth,
|
height: documentWidth,
|
||||||
width: documentWidth,
|
width: documentWidth,
|
||||||
printBackground: true,
|
printBackground: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user