Show HN: Simple PDF to PNG Server
11–20 of 58 posts
Re: Show HN: Simple PDF to PNG Server
#12Before I upload and download a file from a random Show HN with URLs like "secretpage-canneverbefound" and "very-secure-manifest-convert", I'd like to see some source code. Typically with little projects like this it is customary to discuss how you built the application.
The reason they're named that way is an artifact of how this was meant to be a private service to let a remote cloud browser view PDF (etc) files securely, without forcing the client to download them.
So initially I didn't intend to make this public as its own service because the service was supposed to have only 1 customer (this other service).
It wasn't easy at first, as ImageMagick took a long time to convert PDFs at 300 dpi, so I rebuilt it with multicore support, and still it took a long time. I eventually discovered a sweet spot at 100dpi.
But aside from that I tried to keep it very simple, it's just some Node.JS and some shell scripts running on FreeBSD on digital ocean.
Re: Show HN: Simple PDF to PNG Server
#13Earlier quoted context omitted.
Github? I would love to contribute.
Yep, I just put it up now https://github.com/crislin2046/p2 .
Re: Show HN: Simple PDF to PNG Server
#14With superb open source, cross platform libraries like pdfium available to the public, why won't I just do this on the client?
Another reason is I made this to convert the PDF (or Word doc, XLS, etc) remotely without the file ever touching the user's device. So they couldn't be exposed to any exploits contained in the file or of the PDF engine (PDFium recently caused a Chrome 0 day I think).
Re: Show HN: Simple PDF to PNG Server
#15Earlier quoted context omitted.
Nice. What is your tech stack to serve it?
Just a digital ocean droplet running FreeBSD, then PM2 running Node.JS and ImageMagick built with multicore support.
Re: Show HN: Simple PDF to PNG Server
#16Earlier quoted context omitted.
Yep, I just put it up now https://github.com/crislin2046/p2 .
Note that HN (and probably many others) won't correctly autolink URLs with a period at the end. It's also somewhat confusing. You may want to consider removing it.
edit: I like the dot ¯\_(ツ)_/¯
Re: Show HN: Simple PDF to PNG Server
#17Earlier quoted context omitted.
Just a digital ocean droplet running FreeBSD, then PM2 running Node.JS and ImageMagick built with multicore support.
ImageMagick with "multicore" support won't speed things up the moment number of concurrent requests touches the number of cores you have. And in digital ocean's case you have only one core.
Re: Show HN: Simple PDF to PNG Server
#18With superb open source, cross platform libraries like pdfium available to the public, why won't I just do this on the client?
OK, that's a good point. I think the only reason was I looked at PDF.js and felt the quality was not so good, and then I tried ImageMagick and found it gave good quality, so I just went with that. Another reason is I made this to convert the PDF (or Word doc, XLS, etc) remotely without the file ever touching the user's device. So they couldn't be exposed to any exploits contained in the file or of the PDF engine (PDF…
I typically don't like using remote resources for stuff that I can do locally. But for iffy pdfs, it's a good tradeoff.
Edit: Nice to see the PDF capability added :)
Re: Show HN: Simple PDF to PNG Server
#19With superb open source, cross platform libraries like pdfium available to the public, why won't I just do this on the client?
OK, that's a good point. I think the only reason was I looked at PDF.js and felt the quality was not so good, and then I tried ImageMagick and found it gave good quality, so I just went with that. Another reason is I made this to convert the PDF (or Word doc, XLS, etc) remotely without the file ever touching the user's device. So they couldn't be exposed to any exploits contained in the file or of the PDF engine (PDF…
Re: Show HN: Simple PDF to PNG Server
#20Yeah, let's just upload our files to a page that's called "secretpage-canneverbefound.html", and with no info other than the 5 word title on HN. -_-
I mean you don't need to upload a PDF list of all your darkest secrets.