The same font size is rendered differently in main part and headerTemplate while printToPDF in headless mode
Reported by
s.ple...@gmail.com,
Apr 14 2018
|
|||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) 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 @68.0.3398.0
2. Generate PDF
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
const content = '<h1 style="font-size:20px;margin: 0;">First <span style="background: yellow">second</span> third</h1>';
try {
await page.setContent(content);
await page.pdf({
displayHeaderFooter: true,
path: 'size_bug.pdf',
printBackground: true,
headerTemplate: content,
margin: {
top: '60px'
}
});
} catch (e) {
console.error(`Something went wrong: ${e.message}`);
} finally {
await browser.close();
}
})();
What is the expected behavior?
Font size should be the same in header and in main content.
What went wrong?
The font size is 20 in header and 15 in main content in spite of html font-size:'20px'
Did this work before? No
Chrome version: 68.0.3398.0 Channel: dev
OS Version: 10.0
Flash Version:
,
Apr 16 2018
,
Sep 11
I can confirm I can replicate the issue. A workaround is to apply a CSS 3 transformation of 0.75 on the font. Images, however, have the right dimensions.
,
Sep 19
|
|||
►
Sign in to add a comment |
|||
Comment 1 by susan.boorgula@chromium.org
, Apr 15 2018