3 ms·
wkhtmltopdf frustrates me to no end. I've even got a wrapper script to help iterate through it's various major versions and option flags in an attempt to get us
by brbsix 11y ago
wkhtmltopdf frustrates me to no end. I've even got a wrapper script to help iterate through it's various major versions and option flags in an attempt to get usable PDFs. I really hope this is a significant improvement.
- sarreph 11y agoAgreed (and same). I get that it's hard to convert web elements (via Chrome) to a readable/nice PDF, but wkhtmltopdf really isn't the miracle tool it is made out to be. Like you, I have to tweak the options majorly, and even then it fails to support proper page breaks between text lines (i.e. a line of text that is cut across a page break looks so unprofessional). We are in need of a true web to PDF conversion tool; it's one of those things that is overlooked in the business sector but represents quite a valuable niche.
- dbuxton 11y agoPlease stress-test and feel free to submit problem cases as issues to the github repo [0]. "Aggressive mode", which leverages Chromium's "simplify page" mode, might do some of what you want, but typically you need some of the funky print css classes to enforce widows/orphans. The main reason we have built this however is that wkhtmltopdf just crashes all the time. Other commenters seem to agree. We'd love feedback on whether Athena works in cases that other tools fail, as well as on quality of conversion. [0]: https://github.com/arachnys/athenapdf https://github.com/arachnys/athenapdf
- NicoJuicy 11y agowkhtmltopdf doesn't frustrate me a lot. Except when doing multiple pages and multiple table, footers and headers, splitting tables correctly. Ow yeah, and the difference with local files between windows and linux. That's about it :) PS. I use it to create invoices, there aren't a lot of alternatives for it though. So i'm happy it's here! I don't think it's an easy problem to solve..
- NDizzle 11y agoWhat options did you settle on? I have used it in production for chopping up roughly 35,000 documents (and counting) and I have somewhat bare-bones options. Here's what my code looks like: http://pastebin.com/KB15Q6GM http://pastebin.com/KB15Q6GM I'm only really using --disable-internal-links and --no-outline, but sometimes I force a stylesheet.
- brbsix 11y agoHere's what I'm using, albeit a different approach. I don't have thousands of docs to worry about, so I just want a quick preview to ensure the PDF is created as expected. https://gist.github.com/brbsix/546b732a9578343b114b425691c7906f https://gist.github.com/brbsix/546b732a9578343b114b425691c79... Typical use would be `makepdf -o URL`. This saves the PDF in a temp folder, opens it to preview, then asks to save. If it encounters any fatal errors, it iterates through the available `wkhtmltopdf` binaries on PATH (I've got a couple) until it finds the first one that works. Then there are a few options that can be added (ignore, lowquality, disable-javascript) and it will feed the appropriate option string for that version of `wkhtmltopdf` (since option strings may vary by version).
- nightbrawler 11y agoWe started off using wkhtmltopdf for the reporting module in our application to generate PDF's. After using that for a while and searching far and wide for an alternative, we settled on PrinceXML and haven't looked back. It's not OSS, but it's really awesome... once integrated, just set it and forget it. http://www.princexml.com/ http://www.princexml.com/
- tmd83 11y agoWe are thinking about moving to PrinceXml from java flyingsaucer which doesn't deal with newer html construct. Looks to be really good but good to have other feedbacks.