mrafiqk / html-pdf-node

187 stars 119 forks source link

More options for inputs #25

Open martofeld opened 3 years ago

martofeld commented 3 years ago

As of now the only options available for input are content and url. Inputing a content causes it to be compiled by handlebars which is an extra step that might not be necessary. I propose adding the following inputs

The only issues I saw is that when using template and path the content can't contain custom handlebars helpers, but in that case the consumers would have to use html which is just a replacement of content.

With the above properties it's possible to deprecate content as it can be replaced by any of the above but with the consumers knowledge of whats going on.

I'd be happy to create a PR for this, but I'd like your input @mrafiqk

isviridov-web commented 3 years ago

@mrafiqk could you please provide example how to use preferCSSPageSize: true. I mean where i should paste @page{size: ...} to work it when generating pdf.