Live data from Hacker News

Show HN: Make Your PDF Look Scanned

scanyourpdf.com

51–60 of 177 posts

Re: Show HN: Make Your PDF Look Scanned

#51
post #2

I recently came across a couple of institutions which required me to print, sign and send back a couple of documents. COVID and all of that means I don't have a printer at home. I made this website by inspiration from other posts here and now it's free to use! Code is open source so feel free to comment any new ideas or things you would like includede!

> COVID and all of that means I don't have a printer at home.

I recently felt privileged enough to get a printer at home in the workroom of my 2bd apartment in San Francisco.

And yet, it ran out of toner! The notaries wanted documents already printed! The print shops are all closed! What the deuce!

I got one to sympathize with me, she wouldn't take my flash drive, but ran out of excuses when I said I have the files on my iphone's file section and could email them.

Re: Show HN: Make Your PDF Look Scanned

#52

Earlier quoted context omitted.

isn't this a problem? https://github.com/baicunko/scanyourpdf/blob/master/convertp...

I manually modified the private key on the server before publishing here. Still learning on ENV VARIABLES and I couldn't make them work!

haha this is like those domain name search websites that just automatically register the good sounding domain names for themselves once the user types it in.

do you OP! I think it still provides a service, enjoy all the secrets

Re: Show HN: Make Your PDF Look Scanned

#53

Earlier quoted context omitted.

isn't this a problem? https://github.com/baicunko/scanyourpdf/blob/master/convertp...

I manually modified the private key on the server before publishing here. Still learning on ENV VARIABLES and I couldn't make them work!

You might want to just switch to a dotenv library. Quick Google for Django yielded https://github.com/jpadilla/django-dotenv

Re: Show HN: Make Your PDF Look Scanned

#55

I can't believe that I'm saying this but this is soooo needed. It's ridiculous to me how many organizations still require hand-signed copies as if that is somehow a deterrent to anything.

if only there was a global pandemic that specifically targeted the legal counsel who would maintain these requirements

Re: Show HN: Make Your PDF Look Scanned

#56

Earlier quoted context omitted.

It's still far short of being suitable for use of any private documents. https://github.com/baicunko/scanyourpdf/blob/master/pdfwebsi... This is rather less than secure; output files are named, e.g., "Scan_2020512_{four random lower-case letters}.pdf" into a web-server-readable directory. That gives a total of 456976 different possible filenames on a day. It's more than feasible to brute-force that many filenames in…

Thank you for the comments. I agree with you, I will decrease how long the file is in the server (I just hit 40gb from hacker news) as well as implement rate limiting to prevent any brute force

Rate limiting (if by that you mean at the firewall or the web server) is not the way to do it. That shifts the problem somewhere else in the stack, into a place that isn't under version control in the same repository.

Consider: If you moved this on to another server, would you remember to enable rate limiting there? If someone else uses your code, will they know to enable rate limiting?

Rate limiting isn't a bad idea, but your security should not depend on it, especially as you have a way of securing it in your application. base64.b16encode(os.urandom(8)) will give you a 64-bit, filename-safe, as-close-to-random-as-reasonable suffix that should be long enough to make it brute-force-proof :)

The same reasoning applies to the cron job (I presume) that is cleaning your files - that's something you have to remember to set up for future (re-)deployments.

Edit: I'd also like to add that showing your code on HN takes bravery and this is, in fact, a neat tool that solves a problem I really wish didn't exist. So, good work on both counts :)

Re: Show HN: Make Your PDF Look Scanned

#57

It looks like what is being used for the transformation is: 1) set to grayscale (optional), 2) add blur, 3) slight rotational tilt, 4) add gaussian blur (?) You can go one further by randomly adding tiny artifacts (ie. specks) to add even more realism. Maybe even a simulated crease in a corner.

I will check regarding artifact. Also someone else mentioned to add random rotational tilt per page to ensure it looks more "legit"

Re: Show HN: Make Your PDF Look Scanned

#59
Is this project different in some way from many already existing solutions that do the same?

I like that it is open source and in theory possible to self host since I really wouldn't want to upload my documents anywhere.

I would really like to know if a similar solution exists that is very easy to run locally or if it runs in the browser it does everything client-side?

Re: Show HN: Make Your PDF Look Scanned

#60

Earlier quoted context omitted.

Thank you for the comments. I agree with you, I will decrease how long the file is in the server (I just hit 40gb from hacker news) as well as implement rate limiting to prevent any brute force

Rate limiting (if by that you mean at the firewall or the web server) is not the way to do it. That shifts the problem somewhere else in the stack, into a place that isn't under version control in the same repository. Consider: If you moved this on to another server, would you remember to enable rate limiting there? If someone else uses your code, will they know to enable rate limiting? Rate limiting isn't a bad idea…

Or use a uuid4 for the suffix.
Post reply on HN