Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PDF generation from HTML page for Rails [closed]

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

like image 285
rubyprince Avatar asked Mar 04 '11 13:03

rubyprince


People also ask

How do I automatically convert HTML to PDF?

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.

How do I print a PDF in HTML?

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.


1 Answers

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.

like image 125
Unixmonkey Avatar answered Oct 04 '22 07:10

Unixmonkey