mrafiqk / html-pdf-node

187 stars 119 forks source link

options request: autoPageHeight: true, autoPageWidth: true #70

Open shanebdavis opened 2 years ago

shanebdavis commented 2 years ago

I'm trying to export a large HTML table to PDF, and I want it to all fit on one page (a 1-page PDF). This library works great, but right now I have to make an educated guess and set a width and height big enough to contain the table.

Would it be possible to automatically set the page width and page height to contain the content? For my purposes it would be OK if both were set at once (e.g. autoPageSize), but it would probably be more generally useful if autoPageHeight and autoPageWidth could be set independently. An alternative API option would be to allow width: "auto", height: "auto".

Thank you!

shanebdavis commented 2 years ago

Related to issue #56

FathiGuemri commented 1 year ago

+1