PDF documents with text
wrapping that actually works.
TangentFlow is a browser-based document builder powered by Pretext. Create professional PDFs with mathematically precise text layout — no server, no dependencies, no broken line breaks.
Or install the npm package:
npm install @upbrew/tangentflow
Every PDF library breaks text wrapping.
We fixed it.
PDF is a fixed-layout format with no built-in text reflow. Every library must measure text width and calculate line breaks on its own. Most get it wrong.
Line breaks in wrong places
Most libraries use approximate character-width tables. They break words mid-syllable, split emoji sequences, and produce uneven line lengths.
No Unicode or emoji support
CJK text, Arabic scripts, Hindi ligatures, and emoji are either broken or completely unsupported. Non-English users are an afterthought.
Requires a headless browser
The only accurate workaround is Puppeteer — spinning up Chrome to render HTML to PDF. That means servers, Docker, 150MB of RAM, and 2-5 seconds per document.
Everything you need to generate perfect PDFs.
Pixel-Perfect Wrapping
Pretext measures every glyph mathematically using the browser's font engine. No approximations, no heuristics — pure arithmetic.
Runs in the Browser
No server, no Puppeteer, no Docker. Everything runs client-side in pure JavaScript. Your data never leaves your machine.
Multi-Page Documents
Automatic page breaks with intelligent content reflow. Tables re-render headers on new pages. No content is ever cut off.
Tables That Actually Wrap
Cell content wraps correctly within auto-sized columns. Row heights adjust dynamically. The #1 pain point in PDF generation — solved.
Template System
Start from pre-built templates for reports, invoices, and product catalogs. Customize with headings, paragraphs, tables, and stat cards.
Instant PDF Export
pdf-lib generates standards-compliant PDF files in milliseconds. Download directly from your browser — no round-trip to a server.
How TangentFlow compares.
We combine the accuracy of browser-based rendering with the speed and simplicity of lightweight PDF libraries.
| Feature | TangentFlow | pdfmake | jsPDF | Puppeteer |
|---|---|---|---|---|
| Accurate text wrapping | Yes | Partial | No | Yes |
| Browser-only (no server) | Yes | Yes | Yes | No |
| CJK / Arabic / Emoji support | Yes | Broken | No | Yes |
| Table cell wrapping | Auto-sized | Basic | Plugin needed | CSS-based |
| Generation speed | ~2ms | ~5ms | ~3ms | ~2-5 seconds |
| Bundle size | ~400KB | ~2MB | ~300KB | ~150MB (Chromium) |
| Memory usage | Low | Low | Low | ~150MB+ |
Three steps to a perfect PDF.
Design your document
Add headings, paragraphs, tables, stat cards, and dividers. Use a template or build from scratch. Edit everything inline.
Preview instantly
See a pixel-accurate canvas rendering that matches the final PDF exactly. Pretext measures every line in under 2 milliseconds.
Export to PDF
Download a standards-compliant PDF generated by pdf-lib. Multi-page documents with proper page breaks, headers, and page numbers.
What developers are saying.
We replaced our entire Puppeteer PDF pipeline with TangentFlow. Generation time went from 3 seconds to 4 milliseconds. Our AWS bill dropped 60%.
I spent two weeks fighting jsPDF's text wrapping for our invoice generator. TangentFlow solved it in an afternoon. The table wrapping alone was worth it.
The Pretext engine handles our Japanese and Korean invoices perfectly. No other client-side PDF library comes close to this level of multilingual accuracy.
Use it in your code.
Install the npm package and generate PDFs programmatically. Fluent builder API or JSON schema — your choice.
// Install: npm install @upbrew/tangentflow @chenglou/pretext
import { createDocument } from '@upbrew/tangentflow'
const doc = createDocument({ page: { size: 'a4' } })
doc.heading('Quarterly Report')
doc.paragraph('Revenue grew **23%** year-over-year.')
doc.table({
headers: ['Region', 'Revenue', 'Growth'],
rows: [['North America', '$14.1M', '+13.7%']],
})
const { pages, pageSize } = doc.build()
// → pages = draw commands, feed to pdf-lib or canvas
Start building better PDFs today.
No sign-up required. Open the builder and create your first document in 30 seconds.
Launch TangentFlow