You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please include code that reproduces the issue.
Below is my to code to generate the PDF:
await page.pdf({format: 'A4', displayHeaderFooter: true, headerTemplate: "<p class='header' style='font-size:12px; margin-top: 0px'>Hello Header</p>", footerTemplate: "<p class='footer' style='font-size:12px'>Hello Footer</p>", margin: {top: '100px', bottom: '100px'}});
I am basically trying to set the the top margin for the headerTemplate to 0. But it seems this style is not picked.
If I am giving margin-top value as some negative value, then the header seems to move upwards but it also applies the same margin value to it's left. Weird! ( I have applied the negative value to be -15px)
What is the expected result?
Header should be placed just below the start of page without any margins when I provide margin-top value as 0px. Also, if I give some negative value to margin-top, it should not apply the same value to margin-left, right and bottom.
What happens instead?
Header has some default margins even if we provide inline margins. Is it that Puppeteer internally adds some default margins to headerTemplate and footerTemplate ?
The text was updated successfully, but these errors were encountered:
We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.
We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!
What steps will reproduce the problem?
Please include code that reproduces the issue.
Below is my to code to generate the PDF:
await page.pdf({format: 'A4', displayHeaderFooter: true, headerTemplate: "<p class='header' style='font-size:12px; margin-top: 0px'>Hello Header</p>", footerTemplate: "<p class='footer' style='font-size:12px'>Hello Footer</p>", margin: {top: '100px', bottom: '100px'}});
I am basically trying to set the the top margin for the headerTemplate to 0. But it seems this style is not picked.
If I am giving margin-top value as some negative value, then the header seems to move upwards but it also applies the same margin value to it's left. Weird! ( I have applied the negative value to be -15px)
What is the expected result?
Header should be placed just below the start of page without any margins when I provide margin-top value as 0px. Also, if I give some negative value to margin-top, it should not apply the same value to margin-left, right and bottom.
What happens instead?
Header has some default margins even if we provide inline margins. Is it that Puppeteer internally adds some default margins to headerTemplate and footerTemplate ?
The text was updated successfully, but these errors were encountered: