All threads / Best way to render a page as a PDF

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?

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.

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.