News for hackers. Stuff that matters.
Re:Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using He... by gima on Tuesday August 22, 2017 @07:13AM (#15071287)
It uses Chrome's built-in print-to-PDF functionality via Chrome Debug/DevTools Protocol. In other words it creates PDF files with real vector graphics and text, not just images embedded in PDF.

Page.printToPDF: https://chromedevtools.github.io/devtools-protocol/tot/Page/...

Re:Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using He... by shubhamjain on Tuesday August 22, 2017 @07:20AM (#15071313)
I didn't know that existed. How good is it with corner cases? HTML->PDF is a notoriously difficult problem; even generating PDF is. There are several software services which charge well for doing that (Docraptor, PrinceXML). If it's smooth and handles everything well, is there any reason someone should pay for them?
Re:Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using He... by j_s on Tuesday August 22, 2017 @08:36AM (#15071727)
PDF generation (especially from a JavaScript-enhanced HTML page) has enough corner cases that it is typically best implemented with commercial support paying someone to polish away the rough edges.

There are many "free as in beer" (closed-source), freemium, and/or free trial options offered as a carrot leading to a commercial product. Most have a watermark and/or page count limitations.

http://selectpdf.com/community-edition/ (5 pages max)

Re:Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using He... by gima on Tuesday August 22, 2017 @07:59AM (#15071502)
It's available from the normal Chrome print menu, so you can test it yourself easily. But to answer: I haven't used it extensively, but CSS and Javascript tend to make it a bit tricky. When you are viewing a webpage in the browser, you have one viewport, and scrolling can change the appearance or position of elements. Translating this to one long PDF is troublesome on some websites. As to what companies do that provide this as a service? I've got no clue, maybe brand this as their unique service? :D
Re:Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using He... by cpr on Wednesday August 23, 2017 @01:19PM (#15083312)
(To clarify, Docraptor is just a user-friendly way to use PrinceXML without licensing the latter and setting up all the infrastructure.)
Re:Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using He... by hwc on Tuesday August 22, 2017 @12:13PM (#15073807)
Actually, all printing in Chrome goes through the PDF generator as an intermediate step.