Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm try to move my current paperwork routine towards a paperless workflow (for the “administrative” type of papers, of course… not for serious reading tasks). There is one major annoyance thwarting me: people sometimes require me to print, sign and scan documents. They will not allow me to insert my scanned signature in an electronic file (even converted to PDF). It's for unimportant papers (e.g., not for contracts!), it's a waste of time, but I cannot make them budge.

Thus, I want to design a filter that takes PDF files as input, and gives them a “scanned document” look. What I have thought of so far:

  1. Rasterization at not-so-great resolution. I have a ghostscript-based filter that does it, and I've used it a few times already. But, the documents keeps their “pristine” aspect: white background is still white, etc.

  2. So, I considered getting a “scanned paper” texture from scanning a blank page, and apply it to my document. But: if I put it in front of the content with low opacity, the text might become too blurry; and if I put it behind the content, it works only if content has a fully transparent background (which is not always true for my documents).

  3. Now, I'm thinking TeX/LaTeX would be great tools to do that, but I cannot translate this nice idea into specifics…

So, what would you suggest?

share|improve this question
1  
3  
Is your scanner so crappy that people can tell the difference? I'm not sure I could tell the difference with our scanner. Or do people compare your signature and see that it's always the same? If the second case, sign your name a bunch of times, scan each of them and insert them randomly into your fake scans. –  Alan Munn Jan 19 '13 at 20:13
1  
@AlanMunn with a common flatbed scanner and default settings, it's pretty easy to tell the difference between a rasterized page and a scanned page (I did a blind test with some friends): paper texture, scanner color artifacts (variations in color from what is originally pure black), compression artifacts, … –  F'x Jan 19 '13 at 20:51
2  
@F'x, another option is just adding a (deceitful) watermark like "SCANNED 19JAN13 AT 20:13:31". Y'know, since we're lying. Prolly good enough for your bureaucrats. –  commonhare Jan 20 '13 at 0:03
1  
This solution uses an entirely different program, so I'm not making it an actual answer. Distressing Documents: cthulhureborn.wordpress.com/2012/10/12/distressing-documents –  BESW Jan 20 '13 at 2:44

3 Answers 3

I guess this is a typical "use the right tool for the right task" question and for these kind of transformation, I would look for an ImageMagick solution:

The following is shamelessly taken from the ImageMagick example gallery, where it is described as a filter to simulate a photo copier effect:

convert letter.pdf -colorspace gray \( +clone -blur 0x1 \) +swap -compose divide -composite -linear-stretch 5%x0% as-scanned.pdf

Thereby

enter image description here

becomes

enter image description here

which to me looks pretty scannerish :-)

Fine-Tuning the Result

Lucas suggested to add also a bit of rotation (in the following I added -rotate 1.5 to the convert line), which improves the result even further:

convert letter.pdf -colorspace gray \( +clone -blur 0x1 \) +swap -compose divide -composite -linear-stretch 5%x0% -rotate 1.5 as-scanned.pdf

enter image description here

For a color scan, just leave of the -colorspace gray operator:

convert letter.pdf \( +clone -blur 0x1 \) +swap -compose divide -composite -gamma 0.1 -linear-stretch 5%x0% -rotate 1.5 as-scanned.pdf

color scan

share|improve this answer
16  
I would rotate it by one or two degrees as well -rotate 2 –  Lucas Jan 20 '13 at 5:40
    
@Lucas: Great idea, see edited answer. –  Daniel Jan 20 '13 at 8:50
26  
This is both wonderful and sad at the same time. –  Alan Munn Jan 22 '13 at 2:28
2  
This is brilliant! –  nnunes Jan 22 '13 at 16:45
2  
You can add a coffee stain tex.stackexchange.com/questions/67656/… –  alfC May 6 '13 at 21:55

To get a scanned paper texture, you could just add random noise in the foreground. For example, here is a ConTeXt solution. The randomnoise overlay draws 1000 points of 0.2ex radius, scattered randomly, shifted randomly, and with a random gray tone.

\startuseMPgraphic {randomnoise}
  newnumeric n;     n = 1000 ;
  newpair middle;   middle = (0.5*OverlayWidth, 0.5*OverlayHeight);
  newpath scatter;  scatter = fullcircle scaled 0.2ExHeight;

  for i = 0 upto n :
     fill (scatter randomized 0.1ExHeight) shifted (middle randomized (OverlayWidth, OverlayHeight))
     withcolor (0.2 randomized 0.2)*white;
  endfor

  setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\defineoverlay[randomnoise][\useMPgraphic{randomnoise}]

\setupbackgrounds[page][background={foreground,randomnoise}]

\setuppapersize[A6]

\starttext

\subject {Simulating a scanned paper}
\input ward

\externalfigure[cow][width=2cm]

\stoptext

which gives

enter image description here

You can play around with the size of the dot, and the number of dots to simulate scanners of different quality.

For example, this is what you get with n=10000 and scaled 0.2ExHeight

enter image description here

and this is what you get with n=10000 and scaled 0.05ExHeight

enter image description here

share|improve this answer
26  
This doesn't look like scanned paper at all. This looks like random points were added on the document. –  Antoine Lecaille Jan 20 '13 at 12:55
29  
Aditya, your scanner might need cleaning. –  lodhb Jan 20 '13 at 13:59

you could try http://lookslikescanned.com/

However it works only for the first page of a PDF document.

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

    
It doesn't work (tried twice, both times no file could be retrieved). –  F'x Sep 11 '13 at 22:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.