Generate PDF invoices from database records in a Ruby on Rails application.
Build certificates or reports with precise layout control, custom TrueType fonts, and embedded images.
Create multi-page documents with automatic repeating headers, footers, and page numbers.
Produce internationalized PDFs with UTF-8 text and right-to-left language support for Arabic or Hebrew content.
Install via gem install prawn, embedding custom TrueType fonts requires providing the font files in your project.
Prawn is a Ruby library that lets developers build PDF files entirely from code. Rather than converting a web page or a template into a PDF, it gives you a set of tools to draw and place content on a page from scratch: text, shapes, images, and layout structures. You call it from a Ruby program and it produces a working PDF file as output. The library handles a wide range of content types. You can draw lines, curves, polygons, and ellipses on a page. You can place flowing text with support for TrueType fonts you embed yourself, or fall back to the standard fonts that the PDF format includes by default. Images in PNG or JPG format can be placed and scaled. For documents that span many pages, you can define repeating content like headers, footers, and page numbers so they appear automatically on every page. Prawn also covers internationalization in some depth. It supports UTF-8 text, right-to-left writing for languages like Arabic and Hebrew, and fallback fonts for characters that one font does not cover. There is also a simple grid system for basic layout, support for PDF bookmarks that let readers jump between sections, and optional password protection and encryption for sensitive documents. One thing the README is clear about: Prawn is not an HTML-to-PDF tool. If you have an existing web page you want to turn into a PDF, this is not the right fit. It is designed for situations where you want precise, programmatic control over what goes on each page, such as generating invoices, certificates, or custom reports from data in a Ruby application. Installing it is straightforward with the standard Ruby package manager. The project includes a manual, built from examples in the repository, that walks through most of the available features. The project is actively maintained and accepts community contributions through GitHub.
← prawnpdf on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.