The background color is not rendered in headerTemplate while printToPDF in headless mode
Reported by
dzmitry....@gmail.com,
Apr 24 2018
|
|||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Steps to reproduce the problem:
1. I use puppeteer @1.3.0 and chrome @65.0.3325.181
2. Generate PDF
const puppeteer = require('puppeteer');
(async () => {
const content = '<h1 style="font-size:20px;margin: 0;background: red">First <span style="background: yellow">second</span> third</h1>';
const browser = await puppeteer.launch();
const page = await browser.newPage();
try {
await page.setContent(content);
await page.pdf({
displayHeaderFooter: true,
path: 'background_bug.pdf',
printBackground: true,
headerTemplate: content,
margin: {
top: '100px'
}
});
} catch (e) {
console.error(`Something went wrong: ${e.message}`);
} finally {
await browser.close();
}
})();
What is the expected behavior?
The background color should be rendered in a header.
What went wrong?
The background color is not rendered in a header.
Did this work before? No
Chrome version: 65.0.3325.181 Channel: n/a
OS Version: OS X 10.13.3
Flash Version:
,
Apr 25 2018
The issue seems to be out of Te-scope as it is related to puppeteer automation tool. Hence, adding label TE-NeedsTriageHelp for further investigation from dev team. Thanks...!!
,
May 14 2018
,
May 16 2018
The pdf looks the same in Acrobat Reader, so not a PDF Viewer bug. I don't have the context for Puppeteer, but if there is a bug, it's on the side of generated the PDF.
,
May 17 2018
Mac triage: marking for Headless triage. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by sindhu.chelamcherla@chromium.org
, Apr 24 2018