
react-pdf
Create PDF files using React
Coldcast Lens
react-pdf lets you build PDFs the same way you build React components. Document, Page, Text, View — if you know React, you already know the API. Generate invoices, reports, or contracts with the same component model and styling approach you use for your UI. Works in browser and Node.js.
pdfkit is the lower-level Node.js alternative with more control but imperative code. puppeteer can render HTML to PDF but needs a headless browser — heavy for server-side generation. Commercially, DocRaptor and Prince XML handle complex PDF layouts better.
Use react-pdf if your app already lives in React and you need programmatic PDF generation. Invoices, receipts, certificates — anything with structured, repeatable layouts. MIT-licensed and actively maintained.
The catch: complex layouts hit limitations fast. CSS support is partial (no CSS Grid, limited Flexbox), and if your PDFs need pixel-perfect reproduction of web pages, you'll fight the renderer. For those cases, puppeteer or a headless Chrome approach is more reliable.
About
- Stars
- 16,476
- Forks
- 1,310
Explore Further
More tools in the directory
Get tools like this delivered weekly
The Open Source Drop — the best new open source tools, analyzed. Free.