PDF libraries for Ruby
- HexaPDF does both: it creates documents (canvas and a layout engine with tables) and modifies existing files: merge, split, rotate, fill forms, encrypt, sign, optimize, extract text. Pure Ruby. AGPL or commercial.
- Prawn is the standard Ruby PDF generator: text flow, fonts, images, tables (with prawn-table), page numbering, encryption. It can’t read existing PDFs. Ruby license or GPL.
- pdf-reader extracts text, metadata, fonts and raw objects from existing files. MIT.
- CombinePDF merges, splits, rotates and stamps pages of existing PDFs, and adds page numbers. Pure Ruby, MIT.
A common combination is Prawn to generate pages, CombinePDF to merge them or stamp them onto existing files, and pdf-reader to read text. HexaPDF covers all of these if the AGPL or a license fee is acceptable.
- CombinePDF CombinePDF is a pure-Ruby library to merge, split, rotate and stamp PDF pages. How to install it, merge PDFs, extract pages, rotate, add watermarks.
- HexaPDF HexaPDF is a pure-Ruby library to create and modify PDF files. How to install it, create a PDF, extract text, merge and split PDFs, rotate pages, fill forms.
- pdf-reader pdf-reader is a pure-Ruby library to read PDF files: extract text, text runs with positions, metadata, fonts and raw objects. Installation and Ruby examples.
- Prawn Prawn is the standard Ruby library for generating PDF documents. How to install it, create a PDF with text, use TrueType fonts, add images and tables.