External style sheets are added by link is not applied 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:
Steps to reproduce the problem:
1. I use puppeteer @1.3.0 and chrome @65.0.3325.181
2. Generate PDF
File ./style.css:
p { color: red; }
const puppeteer = require('puppeteer');
(async () => {
const content = '<html><head><link rel="stylesheet" href="style.css"></head><body><p style="font-size: 20px">Test</p></body></html>';
const browser = await puppeteer.launch();
const page = await browser.newPage();
try {
await page.setContent(content);
await page.pdf({
displayHeaderFooter: true,
path: 'stylesheet_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?
External style sheets are added by a link (<link rel="stylesheet" href="style.css">) should be applied to HTML content in header.
What went wrong?
External style sheets are added by a link (<link rel="stylesheet" href="style.css">) is not applied applied to HTML content in 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 21 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by sindhu.chelamcherla@chromium.org
, Apr 24 2018