# Prawn

Ruby library for programmatic PDF drawing, text layout and image placement\.

ID: Q621 · Revision: 669

Type: software · License: Matz's Ruby\-style terms OR GPL\-2\.0 OR GPL\-3\.0[^license] · Status: active

Website: https://prawnpdf.org/



Prawn is a Ruby library for generating PDF documents through code\. It provides text rendering, vector drawing, image placement, navigation outlines and repeated page content\. It is a document\-generation building block rather than a complete reporting application or an HTML\-to\-PDF renderer\.[^readme]

## Capabilities and substitutions

### Code\-driven PDF creation — supported

Ruby APIs create text, vector graphics and repeated page content\.[^readme]

Use case: Generate PDFs from application code · Platforms: Ruby, JRuby · Region: Version, build and integration requirements apply

### Rich HTML conversion — unsupported

Limited inline text styling is not a general HTML/CSS renderer\.[^readme]

Use case: Generate PDFs from application code · Platforms: Ruby, JRuby · Region: Version, build and integration requirements apply

### Text\-box overflow handling — limited

Truncation is the default; callers can inspect unprinted text or choose another overflow mode\.[^text]

Use case: Generate PDFs from application code · Platforms: Ruby, JRuby · Region: Version, build and integration requirements apply

### Raster image embedding — limited

The core image API supports JPEG and PNG, with performance considerations for alpha\-channel PNGs\.[^images]

Use case: Generate PDFs from application code · Platforms: Ruby, JRuby · Region: Version, build and integration requirements apply

### [Substitute for ReportLab Toolkit](/reportlabtoolkit) — limited

Can replace direct application\-generated PDF layouts when moving the implementation to Ruby; ReportLab's Python APIs and higher\-level layout objects must be rewritten\.[^readme][^reportlab]

Use case: Generate PDFs from application code · Platforms: Ruby, JRuby · Region: Version, build and integration requirements apply

## References

[^readme]: [Prawn 2\.5 documentation](<https://prawnpdf.org/docs/prawn/2.5.0/>) — Capabilities, non\-HTML scope, supported runtimes and release policy (vendor; retrieved 2026-10-07T13:35:17Z)

[^text]: [Text API](<https://prawnpdf.org/docs/prawn/2.5.0/Prawn/Text.html>) — Font coverage, formatted text and text\_box overflow (vendor; retrieved 2026-10-07T13:35:17Z)

[^images]: [Image API](<https://prawnpdf.org/docs/prawn/2.5.0/Prawn/Images.html>) — JPEG/PNG support, positioning, fitting and alpha\-channel costs (vendor; retrieved 2026-10-07T13:35:17Z)

[^bounds]: [Bounding boxes](<https://prawnpdf.org/docs/prawn/2.5.0/Prawn/Document/BoundingBox.html>) — Relative coordinates, calculated height and page movement (vendor; retrieved 2026-10-07T13:35:17Z)

[^license]: [Prawn license](<https://github.com/prawnpdf/prawn/blob/master/LICENSE>) — Alternative terms and generated\-output clause (vendor; retrieved 2026-10-07T13:35:17Z)

[^reportlab]: [ReportLab introduction](<https://docs.reportlab.com/reportlab/userguide/ch1_intro/>) — Python\-based direct PDF generation and higher\-level layout (vendor; retrieved 2026-10-07T13:35:17Z)

Source revision: https://substitutefor.net/entities/Q621?revision=669
