Live data from Hacker News

Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome

github.com

11–20 of 82 posts

Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome

#11
post #8

idea: using this as "send to kindle" generating pdfs from urls you stumble upon, and seamlessly sending them to the *@kindle.com email address to consume in the device I don't know if there's an easier way or service these days

I use the Push to Kindle app from FiveFilters.org to do this.

Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome

#12
post #4

Headless chrome is awesome. I'm using it to generate multiple PNG from SVG.

I agree with you but as a 'old' developer, I find it pretty sad that you have to fire up a headless browser + its gigaton of code, to convert a SVG to PNG. But I agree with you, headless chrome can be very useful.

I take your point in general, but I'm not sure this specific task - converting of SVGs - has ever been one that has easily been solved by some tiny amount of code: probably the way I would have done this in the past (say, ten years ago) would have been using Apache Batik's rasteriser, which is far from a lightweight solution itself.

Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome

#13
post #4

Headless chrome is awesome. I'm using it to generate multiple PNG from SVG.

I agree with you but as a 'old' developer, I find it pretty sad that you have to fire up a headless browser + its gigaton of code, to convert a SVG to PNG. But I agree with you, headless chrome can be very useful.

We currently use Apache Batik (JVM/Scala) to generate PNG for server generated SVGs of charts. SVG is wonderful for generating charts, easy even without any framework.

Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome

#14
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.

Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome

#15

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 .

Appreciate it. EmailThis lookes very cool! I have considered using Puppeteer for pdf-bot, it came out right after I finished it :-)

Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome

#16
post #6

Pretty cool! Check out Google's headless browser API Puppeteer too, they provide a few really useful functions for doing stuff like this. https://github.com/GoogleChrome/puppeteer/blob/master/exampl... Really easy to work around, I used it to build a simple CLI to generate device screenshots of a webpage by modifying the user-agent and resolution to match each device. https://github.com/umpox/generateDeviceScreenshot…

Yeah I think Puppeteer is a very cool project. Unfortunately, it came out literally one or two days after i finished the initial version of pdf-bot. Maybe I will incorporate it soon! :-)

Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome

#17
post #8

idea: using this as "send to kindle" generating pdfs from urls you stumble upon, and seamlessly sending them to the *@kindle.com email address to consume in the device I don't know if there's an easier way or service these days

That is a cool idea! Would only require to setup a small server as webhook endpoint that creates the e-mail.

Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome

#18
post #8

idea: using this as "send to kindle" generating pdfs from urls you stumble upon, and seamlessly sending them to the *@kindle.com email address to consume in the device I don't know if there's an easier way or service these days

I use a script that implements calibre's ebook-convert command line to convert and mail mobi files to myself from html urls. The ebook-convert command is powerful enough that I can join several html pages together, and also add chapter hooks and titles. I used to use this to download and read Wheel of Time rereads on Tor for a while.

Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome

#20
I am guessing this works by splitting screenshots of a web page and gluing them as pages in the PDF file. Doesn't that mean the size of the PDF would grow to be large once it passes few pages? How does it handle content (like, tables) that don't have line breaks?
Post reply on HN