Skip to content

Commit

Permalink
added some console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Panduss committed Feb 8, 2023
1 parent 4878273 commit 71606f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118433,10 +118433,15 @@ async function generatePdf() {
headless: chromium.headless,
ignoreHTTPSErrors: true
});
console.log('puppeteer is launched')

const page = await browser.newPage();
console.log('new page done')
await page.setContent(html, {waitUntil: ['load', 'domcontentloaded', 'networkidle0']})
console.log('content is set')
await page.addStyleTag({path: __nccwpck_require__.ab + "pdf.css"});
console.log('style is set')

const pdf = await page.pdf({
format: 'A4',
printBackground: true,
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,15 @@ async function generatePdf() {
headless: chromium.headless,
ignoreHTTPSErrors: true
});
console.log('puppeteer is launched')

const page = await browser.newPage();
console.log('new page done')
await page.setContent(html, {waitUntil: ['load', 'domcontentloaded', 'networkidle0']})
console.log('content is set')
await page.addStyleTag({path: __dirname + '/styles/pdf.css'});
console.log('style is set')

const pdf = await page.pdf({
format: 'A4',
printBackground: true,
Expand Down

0 comments on commit 71606f5

Please sign in to comment.