Niko Efimov
Niko Efimov

Reputation: 2213

Advanced PDF Generation with Ruby / Rails

We have a document management system written in PHP that uses mPDF to generate rather complex PDFs. We grew to love it, and mPDF allowed us to:

We want the new version of the system to be writen on Ruby on Rails, and for that we would need a Ruby PDF Generation alternative. We checked out Prawn, PDFKit, Wicked PDF, and Prince XML, but reading their docs (which are often one page worth), I'm not sure if they are as feature-full as mPDF. They seem to go for the "Easy of Use" rather than functionality.

Is there a PDF Generator for Ruby that is as advanced as mPDF, or should be keep PDF generation PHP-based as it is?

Upvotes: 2

Views: 1797

Answers (2)

Paul Jowett
Paul Jowett

Reputation: 6581

You might want to look at Docmosis which has a Ruby example in the sample code for talking to their Document engine. The templating capabilities are pretty good and I've seen it producing large documents. I don't think it can stitch/import PDFs so you would have to use it with another library that can do the combining.

Please note I work with the company that produces Docmosis.

Upvotes: 0

phoet
phoet

Reputation: 18835

mPDF seems to be a composite tool that uses a portable PDF lib and an html2pdf converter.

it's hard to compare those to the libs/tools you mentioned. PrinceXML should be similar to html2pdf, but you could also use wkhtml2pdf (PDFKit, WicketPDF), which uses webkit and is free of charge.

combining those with prawn, which would translate to FPDF in PHP, should do everything you need.

Upvotes: 1

Related Questions