# TinyPDF – 3kb pdf library (70x smaller than jsPDF)

I needed to generate invoices in a Node.js app. jsPDF is 229KB. I only needed text, rectangles, lines, and JPEG images. So I wrote tinypdf: <400 lines of TypeScript, zero dependencies, 3.3KB minified+gzipped. What it does: - Text (Helvetica, colors, alignment) - Rectangles and lines - JPEG images -…

- **Page:** https://magpie.gallery/i/tinypdf-3kb-pdf-library-70x-smaller-than-jspdf-076j
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Tags:** pdf, typescript, library, invoices, lightweight

## Source

Web · lulzx: TinyPDF – 3kb pdf library (70x smaller than jsPDF)

- **Original:** https://news.ycombinator.com/item?id=46316968

> I needed to generate invoices in a Node.js app. jsPDF is 229KB. I only needed text, rectangles, lines, and JPEG images. So I wrote tinypdf: <400 lines of TypeScript, zero dependencies, 3.3KB minified+gzipped. What it does: - Text (Helvetica, colors, alignment) - Rectangles and lines - JPEG images - Multiple pages, custom sizes What it doesn't do: - Custom fonts, PNG/SVG, forms, encryption, HTML-to-PDF That's it. The 95% use case for invoices, receipts, reports, tickets, and labels. GitHub: https://github.com/Lulzx/tinypdf npm: npm install tinypdf https://github.com/Lulzx/tinypdf

## GitHub projects

- https://github.com/Lulzx/tinypdf

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
