{"by":"lulzx","descendants":33,"id":46316968,"kids":[46331954,46332542,46332563,46331442,46325132,46333139,46331807,46333500,46333379,46318901,46402176,46333939,46335049,46335708,46333380,46337492,46337561,46330949],"score":253,"text":"I needed to generate invoices in a Node.js app. jsPDF is 229KB. I only needed text, rectangles, lines, and JPEG images.<p><pre><code>  So I wrote tinypdf: &lt;400 lines of TypeScript, zero dependencies, 3.3KB minified+gzipped.\n\n  What it does:\n  - Text (Helvetica, colors, alignment)\n  - Rectangles and lines\n  - JPEG images\n  - Multiple pages, custom sizes\n\n  What it doesn&#x27;t do:\n  - Custom fonts, PNG&#x2F;SVG, forms, encryption, HTML-to-PDF\n\n  That&#x27;s it. The 95% use case for invoices, receipts, reports, tickets, and labels.\n\n  GitHub: https:&#x2F;&#x2F;github.com&#x2F;Lulzx&#x2F;tinypdf\n  npm: npm install tinypdf</code></pre>","time":1766084373,"title":"Show HN: TinyPDF – 3kb pdf library (70x smaller than jsPDF)","type":"story","url":"https://github.com/Lulzx/tinypdf"}