I am looking for a tool to convert HTML view pages to PDF from Rails. I want the styles to be intact and should be able to identify CSS styles. I have heard of Prince XML and Wicked PDF. I want to know the advantages and disadvantages of using one of them. Also, I want to know whether the rendering of PDF has any problems with regard to the style(whether style will be properly rendered). If there is any other tools, please inform about them.
Thanks, Prince
On a Windows computer, open an HTML web page in Internet Explorer, Google Chrome, or Firefox. On a Mac, open an HTML web page in Firefox. Click the “Convert to PDF” button in the Adobe PDF toolbar to start the PDF conversion. Enter a file name and save your new PDF file in a desired location.
Most modern browsers (e.g., Chrome, Edge, and Firefox) now have the feature to print to a PDF instead of a printer. Press the shortcut key Ctrl + P to print the page, and then in the print window that appears, change the Destination to Save as PDF or choose Adobe PDF as the printer.
PDFkit is pretty nice from what I've seen, but I'm a big fan of wicked_pdf for the fine-grained control you can get over your documents.
PrinceXML and princely are great, but expensive. DocRaptor is a great web service that can let you dip your toes in, but the only things prince really does better than the free wkhtmltopdf-based solutions are its ability to properly do page-breaks without cutting table rows and repeating headers.
Disclaimer: I am one of the maintainers of wicked_pdf, and good friends with the people who run DocRaptor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With