Aymkdn / html-to-pdfmake

This module permits to convert HTML to the PDFMake format
https://aymkdn.github.io/html-to-pdfmake/index.html
MIT License
545 stars 88 forks source link

Displaying footer on everypage when generating PDF through HTML #217

Closed imad-haq closed 2 months ago

imad-haq commented 2 months ago

Hi,

I cannot display footer on everypage when generating PDF through HTML. here is what I'm doing for displaying footer on every page:

#footer { position: running(footer); color: #003B5C; font-size: 10px; font-family: Mulish; } @media print { @page { size: A4; margin-top: 40px; margin-bottom: 40px; @bottom-left { content: element(footer); } } }
"

testing footer
"

Is it evern possible to display footer when generating PDF through HTML? If yes what is the solution?

Thanks

Aymkdn commented 2 months ago

The documentation said: image

Only a very limited number of CSS styles are supported. As explained in the documentation, the idea is to create a PDFMake object using HTML, because PDFMake object is difficult to manually create.

If you want to add footer, you have to do it when passing the result to PDFMake: https://pdfmake.github.io/docs/0.1/document-definition-object/headers-footers/