PejmanNik/puppeteer-report

Feature: Separate Header and Footer pages from the main page.

Closed this issue · 1 comments

Today we have to embed the header/footer html and css into the main page.
This leads for main page styling to be able to clash with header and footer styling, if their code are built separately.

Here I load a footer html, and a footer css, separate from the html we want to print.
Because this I have to inject the code into the main html manually, and opening the footer-template html file doesn't always reflect what it renders, because the css of the main file does set some styling for some tags.

I propose for the header and footer to be rendered separately, so their templates are completely independent of the main page.

It is not easy work to do 😅

I think we can work on CLI to accepting three files (header/foot/content) and inline the CSS (fix conflict in styles) and merge them together, then pass it to the core library to generate pdf.

I'm open to any PR for this issue