Really nice work. I've had a great experience working with Headless Chrome to convert webpages to PDF for my side project EmailThis ( https://www.emailthis.me ). It uses Puppeteer by Chrome DevTools team - https://github.com/GoogleChrome/puppeteer .
Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
71–80 of 82 posts
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#72Earlier quoted context omitted.
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/...
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 Headless Chrome
#73How well does it work with multiple-page PDFs? One of our banes is generating mixed text/image downloadable reports with sensible page breaks. To save time, we're actually doing those as docx files, with the bonus/risk that clients can edit the content before saving it as a PDF.
The holy grail of PDF generators, sensible page breaks. Never been done and makes peace in the middle east seem like an easy task.
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#74How well does it work with multiple-page PDFs? One of our banes is generating mixed text/image downloadable reports with sensible page breaks. To save time, we're actually doing those as docx files, with the bonus/risk that clients can edit the content before saving it as a PDF.
Just use WkhtmlToPdf https://wkhtmltopdf.org and wrap a simple service around it.
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#75Unfortunately, Chrome's kerning when it comes to printing is atrocious. Over the years, I've constantly tested it every once in a while with the hope that it would improve to no avail. Currently, the only print ready HTML to PDF processor that I know is Prince [1] and to a lesser extent Firefox. [1]: https://www.princexml.com/
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#76This is interesting :-) I am currently using athenapdf[1] but I will have a play with pdf-bot. [1] https://github.com/arachnys/athenapdf
Core developer of `athenapdf` here :) I had a quick look at `pdf-bot`, and though we both rely on the same underlying technology (we are only just moving to headless Chromium; we were on Electron before) , I believe we have slightly different ambitions with our respective project. But, I may be biased. For example, `pdf-bot` seems to be tied exclusively to a specific converter, and storage backend. With `athenapdf` h…
I was wondering, does it support custom page headers (or generally running elements)
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#77How does this compare to wkhtmltopdf, which, IIRC, uses WebKit to render the pdf?
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#78Really nice work. I've had a great experience working with Headless Chrome to convert webpages to PDF for my side project EmailThis ( https://www.emailthis.me ). It uses Puppeteer by Chrome DevTools team - https://github.com/GoogleChrome/puppeteer .
Cool project! I think I am going to start regularly making use of it. Does it email you a PDF attachment, or does it just send an email with the contents of the article within it? When I attempted to use it I did not see a pdf attachment. Regardless/either way, really cool project.
If you try saving a any discussion website (HN, Stackoverflow, Reddit), you will get the PDF.
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#79Earlier quoted context omitted.
Core developer of `athenapdf` here :) I had a quick look at `pdf-bot`, and though we both rely on the same underlying technology (we are only just moving to headless Chromium; we were on Electron before) , I believe we have slightly different ambitions with our respective project. But, I may be biased. For example, `pdf-bot` seems to be tied exclusively to a specific converter, and storage backend. With `athenapdf` h…
hi and thanks for athenapdf I was wondering, does it support custom page headers (or generally running elements)
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#80Earlier quoted context omitted.
DonnyV don't you know we need 15 million of the same things in technology :)
Wkhtmltopdf has basically not been updated in years aside from minor bug fixes. It has major issues the author has no plans to fix. I've spend 100s of hours applying workarounds to legacy codebases. All that code could be refactored now. Phantomjs and wkhtmltopdf don't even support doing $(.htmlE).width() from JavaScript. This can complicate laying out the page needless to say. https://github.com/wkhtmltopdf/wkhtmlto…