Live data from Hacker News

URL to PDF Microservice

github.com

81–90 of 95 posts

Re: URL to PDF Microservice

#81

Earlier quoted context omitted.

As long as the workers do not need to coordinate, it should scale. Round-robin those folks.

If there is only one worker the requests can flow directly to that one worker. If there are two workers, something would need to sit in the middle and determine how to distribute the requests. That extra hop is where the extra complexity comes from.

Kanban

Re: URL to PDF Microservice

#84
post #2

I wonder how scalable the service is... At least with PhantomJS I felt like my system would begin to lockup if there were too many instances rendering at the same time (and it didn't appear to be an issue of too little memory). Nonetheless, this looks promising.

Scaling is a challenge definitely. Rendering image-heavy sites requires quite a lot of RAM. But as others have stated, the good news are you can quite easily scale this horizontally by adding more servers. There's no shared state between the server instances behind a load balancer. There's also room for improvement in how efficiently a single server instance can render PDFs. The API doesn't yet support resource pooli…

> Rendering image-heavy sites requires quite a lot of RAM.

Is that the limiting factor? How many would you optimally do in parallel if RAM wasn't an issue?

Re: URL to PDF Microservice

#85
post #70

OT (maybe) Question: I've gotten more and more annoyed over the years as links are deleted/decay etc. Even more so recently. Is there a plug-in that makes a 'personal archive' or potentially on-sends the page to the Archive. It would be useful to be able to search/go back in my time-line to webpages even if they were just static pdf's.

http://pinboard.in

Re: URL to PDF Microservice

#86
post #7

See also: http://any2web.io

with no privacy policy link or info on how long the documents are stored on the server. Stuff like receipts, etc to be converted to PDF will contain customers' information - not to be put on a site with no info on how it's used.

That's a good reminder, thanks. I'm working on a similar service, and need to be very clear about our data retention policy.

Re: URL to PDF Microservice

#87
post #19

Cool. Nice to learn of another option. What would be the advantages of using this over wkhtmltopdf ( https://wkhtmltopdf.org ) ?

wkhtmltopdf is based on QTWebKit, which is truly a pain in the ass to work with. Way more bugs and much less support for modern CSS than Chromium.

Re: URL to PDF Microservice

#88

Oh hey! I created something similar with Flask and Docker. Except you POST the html content and receive a PDF document back. It uses wkhtmltopdf, so it's pretty fast. https://github.com/halfnibble/pdf_service

Wkhtmltopdf is a dead-end, but very useful and relatively ligthweight if it still works for your use case.

Thanks for packaging this up!

Re: URL to PDF Microservice

#89
post #49
post #48

Took a quick skim of the README. I have a general question for these web-to-PDF services. Is the priority to honor the page styles as set forth in a print.css-type file? Or is it to be as close as a screenshot as possible of a webpage, which is what I think the majority of laypeople would expect. One of the small things I've recently let myself be bothered by is how divergent HTML/browser snapshots from web.archive.o…

This service seems to be targeted at producing controlled artefacts from your application (e.g. invoices) where you know what CSS is in use. If you wanted to capture the original design of the page you can use headless Chrome to capture screenshots automatically ( https://medium.com/@dschnr/using-headless-chrome-as-an-autom... ). Perhaps headless Chrome can also save the HTML plus assets, or some other archive format…

Nice find on the bookmark-archiver tool; thanks for sharing!

Re: URL to PDF Microservice

#90
post #75
post #70

OT (maybe) Question: I've gotten more and more annoyed over the years as links are deleted/decay etc. Even more so recently. Is there a plug-in that makes a 'personal archive' or potentially on-sends the page to the Archive. It would be useful to be able to search/go back in my time-line to webpages even if they were just static pdf's.

Wallabag: a self-hostable application for saving web pages | https://news.ycombinator.com/item?id=14686882 (Jul 2017) Show HN: Kozmos – A Personal Library | https://news.ycombinator.com/item?id=14980075 (Aug 2017) specifically: https://addons.mozilla.org/en-US/firefox/addon/scrapbook-x/ and https://chrome.google.com/webstore/detail/worldbrain-the-res...

Linked elswhere in this discussion:

https://github.com/pirate/bookmark-archiver python script

https://chrome.google.com/webstore/detail/singlefile/mpiodij... save as a single html file

> uses "data URI" scheme to embed image and frame contents into the page : the resulting format is not MHT/MHTML

Post reply on HN