Best Practices When Using wkhtmltopdf and wkhtmltoimage at the same time

180 views
Skip to first unread message

Tony Chuinard

unread,
Aug 10, 2015, 12:30:11 AM8/10/15
to wkhtmltopdf General
My application requires me to take a static HTML page and convert it into both PDF and PNG.

Does it make sense to spawn different processes for this? Can the wkhtmltopdf process somehow know to output both a PDF and PNG? Although I do read the stream directly, wkhtmltopdf doesn't write out to my filesystem, so this may not be possible...

My second issue is that I can't use the --print-media-type option with wkhtmltoimage. This is my biggest issue, since my PNG doesn't look like my PDF anymore (because I use page-break CSS).

I almost feel like a better solution would be to just use wkhtmltopdf in conjunction with something like ImageMagick.

Any help is appreciated.
Reply all
Reply to author
Forward
0 new messages