marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 543 forks source link

Only one single PDF page generated #593

Closed MarcGiannuzzi closed 4 years ago

MarcGiannuzzi commented 4 years ago

Hi,

I have a big HTML file that has a lot of text in it. When I use html-pdf to create my PDF, it works well, but only for one PDF page. Actually, it creates 8 pages in the PDF file, but only one is rendered. The others are empty (all white).

I use printBackground, logically to have a background. If I set printBackground to false, I get my 8 pages with text (so the 7 other pages are not empty anymore), but without background and also without any color... However, all of the not-related-to-colors properties of the CSS file work (margins etc).

I use external CSS file inside my HTML.

Here is the options object that I used when creating the PDF : const pdfConfig = { path: pdf_filepath, format: 'Letter', printBackground: true, quality: 100 , height:'10000mm', width: '80mm' };

Thanks for your help !