@shipitandpray/pretext-pdf
Type text below, get a real PDF with proper text wrapping powered by Pretext + pdf-lib
Input
Pretext PDF Demo This library combines Pretext (accurate text measurement and line breaking) with pdf-lib (PDF generation) to produce multi-page PDFs with proper word wrapping, pagination, tables, and images. Unlike raw pdf-lib which only draws single lines, pretext-pdf automatically wraps text to fit the page width, breaks across pages when content overflows, and supports multi-column layouts. Features: - Automatic text wrapping using Pretext's line-breaking algorithm - Multi-page pagination with configurable margins - Multi-column text layout - Tables with auto-sized columns and header repetition - Image placement with alignment options - Standard PDF fonts (Helvetica, Courier, Times) - Fluent API for easy document construction Try editing this text to see the PDF update in real time. Add more paragraphs to see pagination in action. The preview on the right shows the actual PDF that would be generated.
Page Size:
Letter
A4
A5
Legal
Font Size:
10pt
12pt
14pt
16pt
Download PDF
Ready
PDF Preview