5 ms·
There's wkhtmltopdf[1] when you need the PDF functionality. It is licensed with LGPL, so you can make it interop with your commercial product. [1]: https://wkh
by egeozcan 10y ago
There's wkhtmltopdf[1] when you need the PDF functionality. It is licensed with LGPL, so you can make it interop with your commercial product.
[1]: https://wkhtmltopdf.org/ https://wkhtmltopdf.org/
- throwaway2016a 10y agoSecond wkhtmltopdf ... I love PhantonJS but wkhtmltopdf is a better tool for PDFs.
- Hernanpm 10y agodid you have luck with SPA to PDF? I recall I tried it but with no luck for good javascript support.
- throwaway2016a 10y agoSPA as in Single Page Application? We are using it for reports and we are tailoring our HTML specifically to the reports so we haven't had that issue. If I needed Javascript it may not be the best solution. I like that it generates full PDFs (with real text objects) though not just a static image. I'm not sure if you can generate a PDF like that with PhantomJS. I haven't tried.
- Globz 10y agoI have been using it for almost 2 years on a production server to generate html orders to PDF on the fly, such an amazing tool.
- petercooper 10y agoAnd there's its sister project wkhtmltoimage for rendering to images as well :) Sadly, though, the browser seems way behind the times so I think Chrome will win the next round. I built a prototype library for rendering pages to animated GIFs using the Chrome debugging protocol, but headless will make it even easier: https://github.com/peterc/chrome2gif https://github.com/peterc/chrome2gif
- eknkc 10y agoWhile it's much better than PhantomJS, still causes a lot of issues. We run a paid pet project [1] for html to pdf conversion and most of our customers have stories beginning with PhantomJS then moving to wkhtmltopdf then finally going for something else due to issues with both. Headless Chrome might solve this issue once and for all though. [1] https://restpack.io/html2pdf https://restpack.io/html2pdf
- egeozcan 10y agoFor me the only issue was kerning with some specific fonts on windows servers. Do you have any other examples?
- deleted 10y ago[deleted]