Ask A Question

Notifications

You’re not receiving notifications from this thread.

Best way to render a page as a PDF

Damon Delcoro asked in Gems / Libraries

I have tried several methods including PRAWN to generate PDF's. It seem there must be a better way. What is you recommendation?

Reply

I use Prawn exclusively to generate PDFs. The template system and DSL takes a bit to get used to but it's a viable solution. Also PDFKit is good but I've had more luck with Prawn.

What obstacles are you facing that you need help with?

Reply

Unfortunately PDFs are a pretty tricky thing. I've been using Prawn, but it's annoying to use.

I haven't used it, but I think wicked_pdf is probably the way to go.

Reply

I totally forgot about Wicked. It's also a great gem, but there are some gotchas with it as it pertains to stylesheets and layouts. Once you get the hang of it, it's pretty straight forward.

I agree, Prawn is annoying to use but it just works. I have noticed that it's a bit of a memory hog when rendering PDFs with heavy loaded objects.

Reply

This would be a great episode chris

Reply

I've been using Wicked PDF quite a lot in our business applications. The good thing is that you can just use HTML and CSS to generate the PDF and this works perfect to create our invoices. But if you really need pixel perfect PDF's then Prawn is the way to go.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.