Lurker News

Comments (168) 45 threads

jmwilson6 replies#
From the github repo, the site is a wrapper around exactly two shell commands. Instead of uploading your data to an untrusted site, you can run from the comfort and safety of your local computer:

  convert -density 150 input.pdf -colorspace gray -linear-stretch 3.5%x10% -blur 0x0.5 -attenuate 0.25 +noise Gaussian -rotate 0.5 temp.pdf
  gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite -sColorConversionStrategy=LeaveColorUnchanged dAutoFilterColorImages=true -dAutoFilterGrayImages=true -dDownsampleMonoImages=true -dDownsampleGrayImages=true -dDownsampleColorImages=true -sOutputFile=output.pdf temp.pdf
baicunko2 replies#
I'd recommend GS after ImageMagick as IM will hugely increase the size of the output due to rasterization!
miles4 replies#
The above convert command produced credible output only 6KB larger than the input PDF in my limited testing.

Continue this thread — 4 replies

derefr1 reply#
But isn't rasterization necessary for this deception to work? Unless there's some magical scanner out there that's outputting vector images.

Continue this thread — 1 reply

baicunko2 replies#
In summary you could say yes but I wanted to simplify the process for the not-so-techy person. I will work on a Standalone app that simplifies the command and shows a nice GUI for more private documents
ryanwaggoner3 replies#
I hope you don’t take the comment you’re responding to as anything negative. I’m a software engineer and I would use this myself rather than try and remember some arcane command line utility.
ARandomerDude#
Make it a bash script! I have all kinds of scripts for things I don't want to remember in my ~/bin.
cerved#
A software engineer!?? On HN!?? IMPOSSIBLE
baicunko#
Not at all, I'm actually quite happy with all the comments, ideas and feedback I've received on this, really encourages me to keep improving the project
gdilla#
i just tell people the dropbox app will scan docs for you. comes out looking like a photocopy. perfect for the bankers.
cs7022 replies#
Try this one-line ImageMagick command to make COMPACT pseudo-scanned files:

  convert -density 150 ORIGINAL.pdf -colorspace gray +noise Gaussian -rotate 0.5 -depth 2 SCANNED.pdf
Consider using `-depth 1`, `-depth 3` as a final parameter to map colors to only 2¹=2 or 2³=8 instead of 2²=4 gray levels. Using a small number of gray levels SIGNIFICANTLY reduces file size and also gives your pseudo-scanned document a more pixelated, it-just-came-out-of-my-old-printer look.

Also consider using `-density 100` or even `-density 75` for long text documents. Using a density of 75 dpi produces documents that are 4x smaller than 150 dpi (75²=150²/4) and doesn't affect the readability of normal-sized (10-12pt) text that much.
Finally, sometimes it works best not to add Gaussian noise.

miles2 replies#
Rather than making a COMPACT version, your command created a file over twice the size of one created using the aforementioned

convert letter.pdf -colorspace gray \( +clone -blur 0x1 \) +swap -compose divide -composite -linear-stretch 5%x0% -rotate 1.5 as-scanned.pdf
However, that may be a useful feature, since many users end up inadvertently creating very large PDFs when scanning.

Moru1 reply#
If you lower the resolution those auto-scanning services that does OCR on the documents will get problems converting the tex back to normal text. Which might or might not be the point of doing this in the first place... :-)

Continue this thread — 1 reply

cs702#
The output file size relative to other approaches will depend on the contents of the input file (e.g., does it embed any bitmaps, or is it only text in non-rasterized fonts?), the density you use (e.g., 150 dpi is 4x greater than 75 dpi), the bit depth you use (3 bits is 4x greater than 1 bit), and whether you add noise or not. Also, the one-line command above your comment is short/easy to remember and reasonably fast -- which is useful if you're impatient like me.

All that said, note that you can always add a `-compress ` to the convert command, although this could make it noticeably slower, say, for a directory full of long documents. There's even a Fax TIFF compression method that makes the document look like it came out of one of those fax machines you see in movies from the 1980's. To get a list of supported compression methods, type `convert -list compress` at the command line.

baicunko#
I'm taking notes on all comments, I will test what you mentioned to see how the document ends up looking, thanks!
mNovak1 reply#
For other noobish windows users like myself, you can simply dump the following into a bat file. When run, it'll look for a file called "scanThis.pdf" and apply the conversion with ImageMagick.

   IF EXIST scanThis.pdf (magick convert -density 100 scanThis.pdf -colorspace gray +noise Gaussian -rotate 0.5 -depth 2 SCANNED.pdf) ELSE (ECHO File scanThis.pdf not found & PAUSE)
stormdennis1 reply#
Sorry, I'm a long term Windows user but not very proficient. That can't be there entire contents of the bat file, can it? What else goes in there?
mNovak1 reply#
Nope that's it. The bat file here is just a clickable shortcut so you don't have to remember the whole command. The interesting stuff is happening in ImageMagick, which has to be installed already.

Continue this thread — 1 reply

cristaloleg#
Sounds like a plan to compile it into WASM and run locally inside any browser.

To be honest, I'm waiting for a boom of such services, that can be run in a separate tab without any network jumps.

so_serious#
It should be '-dAutoFilterColorImages=true' instead of 'dAutoFilterColorImages=true' for the gs command.
derwiki#
Thought this sounded familiar.
baicunko8 replies#
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!
newx1 reply#
Pretty cool idea!

One suggestion: add thumbnail/preview of how docs will look like after "scanned". Or maybe even a "Before and After" teaser! :)

baicunko#
I'm adding this to the pending in GitHub, great idea
pmiller23 replies#
What do you mean "required"? Like, they wouldn't accept a clean, non-scanned copy? That's absurd.
baicunko2 replies#
I usually sign documents on my iPad but in this case they told me the signature had to be from a pen. COVID and everything means I don't have a printer nor a scanner at home so I developed this to "scan my iPad signed documents" worked like a charm!
pmiller22 replies#
As a technological toy, I think this sort of thing is cool. In fact, you can do it in LaTeX pretty easily: https://tex.stackexchange.com/questions/94523/simulate-a-sca...

It's interesting that the problem they had was with the signature. You can very easily make a handwritten signature on an iPad. I don't see how there's any practical way to tell the difference between a high-quality, handwritten signature done on an iPad with either a finger or an Apple Pencil and a scanned signature done with a pen.
Are you sure that's not just some excuse they gave you?

Continue this thread — 2 replies

centimeter1 reply#
What do you use to sign PDFs on your iPad?

Continue this thread — 1 reply

gumby1 reply#
Banks that need monthly financials to assure regulators that they are servicing their loans are also required to justify the documents to the regulator. If you just autogenerated it perhaps they’re wrong or falsified. While if you have to take out a pen and sign them that won’t happen.

Yes, absurd.

pmiller25 replies#
That's beyond absurd. The content of the document is what determines whether it's falsified or not, and you can inspect the content for inconsistencies on a generated PDF far more easily than a scanned one.

Continue this thread — 5 replies

yosito1 reply#
7 years of being a digital nomad, and signing every document digitally, and I never ran into this. TIL.

Continue this thread — 1 reply

lilyball#
But scanning these documents defeats the point. The law isn't saying "it must be signed with wet ink, but after that a scanned copy is sufficient", it says you need the actual paper with the wet ink signature.

> If you’re a solicitor responsible for registration, you need the other parties' solicitors, on closing, to send you the wet-ink signed parts of the documents. You’ll only proceed when you have the wet-ink signed documents, not when you have seen electronic images of them.

duxup#
What a great technology solution for a very non technical ... sort of luddite-ish introduced problem.

As others noted a before and after pic would be great.

itronitron2 replies#
it occurs to me that you could do this with a lower tech method, just sign your name on a piece of scotch tape and align the tape on the monitor over the document, take a photo with your phone and then use that as the 'scanned image' in the pdf file.
epa#
Who owns pens in 2020?
yipbub#
Taking a picture of a monitor with a will usually result in a Moire pattern[1] since the image sensors is a grid and the display pixels are grid.

Just tried this. Orienting your phone at 45 degrees to the monitor can mostly reduce them, but that's not really that useful.
[1]https://en.wikipedia.org/wiki/Moir%C3%A9_pattern

Continue this thread — 4 more replies

ArneVogel22 replies#
Edit: fixed now.

Original: Please don't upload any private or confidential pdfs right now. I emailed OP two security concerns that trivially allow anybody to see any of the converted pdfs.

Continue this thread — 22 replies

Load more comments