Sometimes you need to fill out and send a document back, and a lot of places expect you to print and scan it, but not always do you have a printer handy or cloes by. In that case, you can fill out all the info directly in the document you received or even create the PDF yourself. You can then run it through ImageMagick and have it look like you filled it out, printed it, and then scanned it.
Have a look at this example. On the left is the original document, filled out and ready to be printed, and on the right the faux scanned version.
If you’re ready to make your own, make sure you have ImageMagick installed, and then run:
convert -density 150 INPUT.pdf -colorspace gray +noise Gaussian -rotate 0.5 -depth 2 OUTPUT-SCANNED.pdf
ImageMagick may complain about the policy not allowing it to process PDFs. You might get a message such as:
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
convert-im6.q16: no images defined `OUTPUT-SCANNED.pdf' @ error/convert.c/ConvertImageCommand/3258.
In that case, just edit it’s policy configuration file that’s usually at /etc/ImageMagick-6/policy.xml
.
sudo vi /etc/ImageMagick-6/policy.xml
Search for the line
<!-- disable ghostscript format types -->
and then soon after it you should see
<policy domain="coder" rights="none" pattern="PDF" />
Just remove that line and save, then rerun the convert command above.