Live data from Hacker News

Show HN: Simple PDF to PNG Server

secureview.cloudbrowser.xyz

11–20 of 58 posts

Re: Show HN: Simple PDF to PNG Server

#12

Before 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.

It looks like the URLs named like that are trying to hack you and steal your secrets, I get that.

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

#13
post #7

Earlier quoted context omitted.

Github? I would love to contribute.

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.

Re: Show HN: Simple PDF to PNG Server

#14
post #11

With 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 (PDFium recently caused a Chrome 0 day I think).

Re: Show HN: Simple PDF to PNG Server

#15
post #5

Earlier 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.

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

#16

Earlier 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.

Oh! Sorry. Let me change that

http://tiny.cc/p2github

edit: I like the dot ¯\_(ツ)_/¯

Re: Show HN: Simple PDF to PNG Server

#17
post #15

Earlier 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.

Actually I created a Droplet with 6 cores

Re: Show HN: Simple PDF to PNG Server

#18
post #11

With 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…

That's a great point.

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

#19
post #11

With 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…

Wow, wasn't expecting such a well constructed counter argument.

Re: Show HN: Simple PDF to PNG Server

#20

Yeah, 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.

No but a mention this is happening serverside and you are actually copying the file to the server kind of notice or message would be correct imho
Post reply on HN