Working with PDFs in Ruby

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Wicked Pdf

    PDF generator (from HTML) plugin for Ruby on Rails

  • We’ll start with the WickedPDF gem, which is powered by the wkhtmltopdf command-line library.

  • WKHTMLToPDF

    Discontinued Convert HTML to PDF using Webkit (QtWebKit)

  • We’ll start with the WickedPDF gem, which is powered by the wkhtmltopdf command-line library.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Prawn

    Fast, Nimble PDF Writer for Ruby

  • to view the email preview (note the PDF attachment included in the email): ![Email preview with attachment](https://www.honeybadger.io/images/blog/posts/ruby-pdfs/email-preview.png) ## Prawn PDF [Prawn PDF](https://github.com/prawnpdf/prawn) is a pure Ruby PDF- generation library that comes packed with features, such as PNG and JPG image embeds, generated file encryption, right-to-left text rendering, a way to incorporate outlines for easy document navigation, and a lot more. Prawn comes with its own DSL, which drives its powerful PDF generation abilities. ### When to Use Prawn Although it's not a fully featured report generation library like the well-known [Jasper Reports](https://community.jaspersoft.com/), with a bit of work using it's powerful DSL, you can generate some really cool and rather complex PDF documents with Prawn. Even so, it's important to note that Prawn isn't everything. If you want to generate PDFs from HTML, then you should look elsewhere, as the gem provides very limited support for inline styling, something of a hurdle if you're working with rich HTML documents. ### Installing and Using Prawn To get started with Prawn, install it with this command: ```bash gem install prawn

  • Pdfkit

    A Ruby gem to transform HTML + CSS into PDFs using the command-line utility wkhtmltopdf (by pdfkit)

  • Like the WickedPDF gem, the PDFkit gem uses wkhtmltopdf on the backend to convert plain HTML and CSS files into PDF documents.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts