4 ms·
Not knowing anything about PDF generation (but will need to soon), what can these libraries do that you can't do with something like a puppeteer web service and
by Scarbutt 4y ago
Not knowing anything about PDF generation (but will need to soon), what can these libraries do that you can't do with something like a puppeteer web service and create PDFs with HTML/CSS?
- px1999 4y agoScale/performance. The interface is also straightforward to use. Puppeteer or any nonembedded process is just unnecessary hassle/overhead in a lot of cases.
- bayesian_horse 4y agoIt's an overhead but not a big one, at least for web applications, especially if they run as containers anyway. And then it really scales like crazy. Yes, this pdf generator may be faster at what it does, but a headless browser with paged media polyfill can do a lot more than this and uses html+css which are widely used standards.
- px1999 4y agoSure, but as others have said, how do you get column headers appearing on each page, put metadata into your documents, make elements properly selectable etc etc "Just run it as a container" is a bit of an industry cop-out for making stuff unnecessarily complex.
- bayesian_horse 4y agoTHEAD is supposed to do that already. You can use hyperlinks. You can postprocess pdf files.
- bigtex 4y agoTables over multiple pages is a major problem. It just doesn’t work with the popular htmlpdf tool that everyone uses to power their tools. That is the use case I am interested in.
- pathartl 4y agoUsing HTML/CSS for PDFs really just isn't a good idea in my experience. It makes layout extremely cumbersome. If you just need to spit some data out onto a page, sure it works I guess. However, doing more complex page layout with an actual design element often introduces scenarios where a markup language just can't work.
- ficklepickle 4y agoI put puppeteer into a serverless function and it worked well enough for low tens of thousands of PDFs a day. It's not fast, nor efficient, but it was reliable and surprisingly cheap. It was a definite improvement over the existing solution which was a terrible proprietary black box that was occasionally returning the wrong invoice, but that is not saying much. It was an easy drop-in replacement because we were already generating invoices in HTML, so we just sent them to the new PDF service instead. Something like this is likely much more efficient than launching a whole browser for each PDF.