Re:Apache PDFBox – A Java PDF Library
by tmd83 on Monday March 21, 2016 @01:33PM
(#11329911)
Anyone has a solution to make pdf from html thats hosted. The java library flyingsaucer is stuck at css 2.1 and not much maintained. I have been meaning to check wkhtmltopdf which will need launching a process but might be the best bet for such work. Anyone has better experience in doing something similar?
[ Parent
| on HN ]
I used wkhtmltopdf on a project, custom built a version of bootstrap from the less files purely for outputting via wkhtmltopdf, it worked really well and produced some nice looking PDF's.
https://youtu.be/TC_uv_AD808?t=1m31s all the PDF's in that video where generated, that was an early alpha of the product.
Re:Apache PDFBox – A Java PDF Library
by silvestrov on Monday March 21, 2016 @02:02PM
(#11330197)
http://www.princexml.com is very good for complex multipage documents but unfortunately it's very expensive.
I implemented this over the weekend using a small VM instance from Google Cloud + PDFBox 2. I set up Apache, wrote a quick PHP script that takes in the URL of the PDF to be converted, downloads it, converts it to HTML with PDFBox and then prints the HTML. I then linked this small piece into a bigger system that uses the converted HTML.
wkhtmltopdf works quite well, I've used it before. A bit of a hassle to get it compiling though.
I have also had great success with wkhtmltopdf. There are pre-built binaries available too: http://wkhtmltopdf.org/downloads.html
I've used phantomjs through the command line for generating pdfs from html using the screen capture functionality (http://phantomjs.org/screen-capture.html).