Searchable by design
Embed TrueType and supported CFF1 font subsets with ToUnicode mappings, including Japanese text when the font has the glyphs.
PDF generation for Ruby
Create precise documents with embedded fonts. Text stays searchable and copyable, and the same input produces the same PDF.
Build reports, exports, and print-ready pages without turning text into a picture.
Embed TrueType and supported CFF1 font subsets with ToUnicode mappings, including Japanese text when the font has the glyphs.
Place text and images alongside vector paths, clipping, links, and document outlines.
Generate deterministic PDF 1.7 files without timestamps changing the result.
Okab requires Ruby 3.2 or newer. Supply a font containing the glyphs you want to render.
gem install okab
require "okab"
font = Okab::Font.load("report.ttf")
document = Okab::Document.new(title: "Report")
page = document.page(width: 595, height: 842)
page.text("Report", x: 48, y: 790, font: font, size: 24)
document.write("report.pdf")
For the complete API and supported formats, read the documentation.