|
I built an open-source library of React components for creating PDF documents: invoices, reports, certificates, data tables, etc. The problem: every time I've needed to generate a PDF in a web app, I've spent 2-3 days fighting with page breaks, orphaned headings, table overflow, and headers/footers. Whether it's Puppeteer, jsPDF, or one of the dozen hosted APIs, the DX always feels like 2014. So I built @docuforge/react-pdf, a set of composable React components that handle the hard parts: - Smart page breaks (no more split table rows or orphaned headings)
- Auto-paginating tables with repeating headers
- Headers/footers with page number interpolation
- Full CSS support (Flexbox, Grid, @media print)
- TypeScript-first with autocomplete for every prop Quick example: import { Invoice, LineItem, InvoiceTotal } from '@docuforge/react-pdf';
<Invoice>
<LineItem description="Consulting" qty={10} rate={150} />
<InvoiceTotal subtotal={1500} tax={135} total={1635} />
</Invoice>
GitHub: https://github.com/Yoshyaes/docuforge
npm: npm install @docuforge/react-pdf
Docs: https://fred-7da601c6.mintlify.app/introductionI'm also building a hosted PDF generation API on top of this (HTML or React in → PDF out, no Chrome to manage), but the component library is fully open source and works standalone with Playwright/Puppeteer. Would love feedback on the component API design. What PDF problems have you had that this doesn't solve? |