You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Edouard Klein 8e7114b9d1 Streamline color and resolution handling 1 week ago
LICENSE Add LICENSE 5 months ago
README.org DocFix: remind users to quote the page numbders 2 months ago
Signature_example.pdf Initial code commit 5 months ago
Signature_guide.pdf Initial code commit 5 months ago
document.pdf Initial code commit 5 months ago
falsiscan.png Initial code commit 5 months ago
falsisign.sh Streamline color and resolution handling 1 week ago
signdiv.sh add trailing quote to directory creation 2 months ago

README.org

FalsiScan: Make it look like a PDF has been hand signed and scanned

For bureaucratic reasons, a colleague of mine had to print, sign, scan and send by email a high number of pages. To save trees, ink, time, and to stick it to the bureaucrats, I wrote this script.

/mirror/falsisign/src/branch/master/falsiscan.png

Installation

Please install the following dependencies:

If necessary, please configure ImageMagick so that it is allowed to fiddle with PDFs: https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion

Clone this repo

git clone https://gitlab.com/edouardklein/falsisign.git

Fedora users can enjoy the package made by Miroslav Suchý (Thanks!): https://copr.fedorainfracloud.org/coprs/msuchy/falsiscan/

Usage

Create a signature sample

  • Print the /mirror/falsisign/src/branch/master/Signature_guide.pdf, preferably on A4 paper,

  • sign in each of the full sized box (this will give 27 different signatures),

  • scan the resulting paper and save it as a pdf (called e.g. signatures.pdf),

  • run ./signdiv.sh signatures.pdf,

  • check in signatures that you have 27 png files correctly cropped. You can manually edit the .png files to your liking.

You can maintain multiple signature directories, or run the above again if you want more than 27 signatures.

False-sign and False-scan a document

  • Get the PDF the bureaucrats want you to print, sign and scan (e.g. document.pdf),

  • run ./falsisign.sh -d document.pdf -s signatures -x 1000 -y 2500 -o document-scanned.pdf:

    • The first argument is the document you need to sign/scan

    • The second argument is the directory with all your different signatures

    • The next two arguments are the X and Y coordinates of where your signature will be. The page dimension is 3560x4752.

    • The last argument is the output file name.

You can also initial and sign a document, and choose the pages where to sign and initial (don't forget to quote the page numbers!). The full usage string is:

Falsisign.

Usage:
    falsisign -d <input_pdf> -x <X> -y <Y> [-p <pages>] -s <sign_dir> [-i <init_dir> -z <Z> -t <T> [-q <pages>]] -o <output_pdf>

Options:
    -d <input_pdf>   The PDF document you want to sign
    -x <X>           The horizontal position in pixels of where the signature will be
    -y <Y>           The vertical position in pixels of where the signature will be
    -p <pages>       Optional space-separated list of pages to sign, e.g. '2 4 10'
                     Defaults to all or only the last if -i is specified
    -s <sign_dir>    Directory where the signatures will be randomly chosen
    -c               Make a clean scan (disable noise and rotation)
    -i <init_dir>    Optional directory where the initials will be randomly chosen
    -z <Z>           Optional horizontal position in pixels of the initials
    -t <T>           Optional vertical position in pixels of the initials
    -q <pages>       Optional space-separated list of pages to initial
                     Defaults to all but the last
    -o <output_pdf>  The output file name