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
I am not able to see a footer.html get injected into the PDF or debug HTML, either via CLI or the Node API.
For example: mdpdf topic.md --style=print.css --footer=footer.html --debug --f-height=40px
does not throw any errors and creates a PDF and HTML page, using the CSS provided, but without any footer tags or content in the debug HTML or PDF. (I'm not sure if it's supposed to appear in the debug HTML or if it's injected in the PDF stage.)
Debugging steps I've tried:
Changing footer to header (also doesn't work)
Path to footer.html is confirmed correct (CLI will fail if path is wrong)
Was able to resolve this after looking through puppeteer/puppeteer#1822 and doing some more debugging on my own. Looks like there are two issues with how Puppeteer is rendering text in headers/footers:
The default text size is 0 if not specified (via inline CSS, for example). Font size must be explicitly declared in headers and footers.
rem units are seemingly interpreted as px, so setting font-size: 1rem renders it essentially invisible. Rem units should not be used to set font size in headers and footers.
I suppose this is a quirk with Puppeteer, but since this issue was logged in 2018, I'm not sure if a fix is on the way. It would be great to add this to the documentation and update the samples so others don't experience the same issue.
hxlnt
changed the title
Footers and headers not inserted (CLI and API)
Footers/headers require inline font-size declaration in px in order to display
Apr 12, 2023
I am not able to see a footer.html get injected into the PDF or debug HTML, either via CLI or the Node API.
For example:
mdpdf topic.md --style=print.css --footer=footer.html --debug --f-height=40px
does not throw any errors and creates a PDF and HTML page, using the CSS provided, but without any footer tags or content in the debug HTML or PDF. (I'm not sure if it's supposed to appear in the debug HTML or if it's injected in the PDF stage.)
Debugging steps I've tried:
footer.html content:
<footer><div style="font-size: 1rem;">TEST</div></footer>
The text was updated successfully, but these errors were encountered: