Pure Ruby library for generating PDFs from code
open sourceRuby OR GPL-2.0-only OR GPL-3.0-onlyself-hostablefree
Prawn is a pure Ruby library for generating PDFs in code: vector drawing, flowing text with limited inline formatting, PDF built-in and embedded TrueType fonts, PNG and JPG images, a simple grid for layout, repeating headers, footers and page numbers, outlines, and encryption with passwords. Its internationalization covers UTF-8 fonts, right-to-left text and fallback fonts, and you can drop down to the PDF object tree for custom extensions. It isn't, and won't be, an HTML to PDF converter.
Problems it solves
- generate invoices as PDFs from Ruby without a headless browser
- draw text, lines and images at exact positions on a PDF page
- build a PDF report in Ruby with headers, footers and page numbers
- write Arabic or Hebrew right-to-left text into a generated PDF
- embed a TrueType font so special characters render in the PDF
- password-protect a PDF we generate
- a pure Ruby PDF writer with no native dependencies
- add a bookmarks outline to a generated PDF
Features
- vector drawing
- flowing text with inline formatting
- built-in and embedded TrueType fonts
- PNG and JPG images
- grid layout
- repeating headers, footers and page numbers
- outlines
- encryption and passwords
- UTF-8, right-to-left text and fallback fonts
- low-level PDF object access
Capabilities
| Takes plugins | plan not known |
|---|
Alternatives
The same job
These do what Prawn does.
- HexaPDF Versatile PDF creation and manipulation for Ruby
- PDFKit A JavaScript PDF generation library for Node and the browser.
- ReportLab The print button for eBusiness
- ironpress HTML to PDF. In process. In pure Rust.
- PDFMonkey PDF Generator API with a visual template builder
- DocSpring Fill PDF forms, generate PDFs and Word documents, and collect e-signatures with one API.
