PejmanNik/puppeteer-report

Support setting margin via CSS

Closed this issue · 2 comments

Puppeteer-report does not respect the margin set by @page rules but only the margin set by PDFOptions. Adding support for this would be a nice to have although not to be underestimated.

The tricky thing is that it is possible for the first page to have a different margin from the rest of the document using the :first pseudo-selector. Admittedly, support for this is buggy across browsers.

Page rules can be checked with JavaScript using document.styleSheets[].cssRules.

As you mentioned, we can not fully support it, but I'm ok with a PR if you need the basic functionality.

the complexity of pseudo-selector makes it almost impossible to support it in this project, I can suggest you take a look at jikji