Skip to main content

Best way to render a page as a PDF

Gems / Libraries • Asked by Damon Delcoro

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


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?


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.


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.


This would be a great episode chris


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.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.