Back in the day I needed PDF export for some client thing. I can't remember if I was using pdfjs or jspdf. I do however remember that it was many thousands of lines of code, and yet, I had to lay out the lines of text on the page manually.
My page layout code was like 50 lines of code. And I remember thinking... OK they already wrote 8,000 lines of code... They couldn't have added 50 more?!
400 lines though. Respect. I will take a proper look at this when I recover from burnout :)
Great exercize, but for most use cases - people will continue reaching for jsPDF.
I think if you have a markdown->PDF function included, where I can send in markdown and get PDF, that would solve quite many needs, and would be useful.
Back in the day I needed PDF export for some client thing. I can't remember if I was using pdfjs or jspdf. I do however remember that it was many thousands of lines of code, and yet, I had to lay out the lines of text on the page manually.
My page layout code was like 50 lines of code. And I remember thinking... OK they already wrote 8,000 lines of code... They couldn't have added 50 more?!
400 lines though. Respect. I will take a proper look at this when I recover from burnout :)
Great exercize, but for most use cases - people will continue reaching for jsPDF.
I think if you have a markdown->PDF function included, where I can send in markdown and get PDF, that would solve quite many needs, and would be useful.
I have added it!
3KB is wild. What features did you intentionally leave out to get this small?
Not the author, but generating PDFs is much, much simpler than parsing PDFs
Support for more than 7-bit ASCII characters. :)
is it related to one of the other 10 products called TinyPDF?
Yes, obviously: it's a tiny PDF library.