mileszs / wicked_pdf

PDF generator (from HTML) plugin for Ruby on Rails
http://www.mileszs.com/wicked-pdf-plugin
MIT License
3.53k stars 642 forks source link

Dynamic height for entire document #563

Open MoZaitoun opened 8 years ago

MoZaitoun commented 8 years ago

Is it possible to set the document height to "AUTO" or something, So that it would change according to the dynamically created content, As I want all data to be in one page?

josem32 commented 7 years ago

+1

jmperez127 commented 7 years ago

+1

unixmonkey commented 7 years ago

There are a few suggestions on how to make that happen in this thread.

My suggestion would be to pipe your temporary html file into wkhtmltoimage and convert the image to a PDF, or get the size of the image, and use that to generate a custom page size for rendering it again as a PDF.

Best of luck. Let me know how it goes!