Automates the signing and dating of PDF documents. Includes configuration to introduce varying aspects of entropy which makes each execution unique, including using different signatures.
The easiest way to run this script is though JBang.
jbang https://github.com/ardetrick/pdf-signer/blob/main/src/main/java/com/ardetrick/pdfsigner/Main.java
Alternatively you can download the code and run Main directly.
The script accepts one argument, a relative path to a properties file. When no file is provided, the example file properties are used to demo the feature without any setup.
jbang https://github.com/ardetrick/pdf-signer/blob/main/src/main/java/com/ardetrick/pdfsigner/Main.java ./different/path/custom.properties
Modify these properties to change the location of the input/output file location.s
# Location of unsigned PDF file
pdf-loader.file-input-name=files/pdf-document.pdf
# Location to write signed PDF file
scan-emulator.file-output-name=files/pdf-document.edited.pdf
# Location of directory containing signatures, if more than one is present one will be randomly selected.
signer.signatures-images-directory=files/signatures
Use these properties to configure the location where the signature should be placed on the PDF.
# Location of the signature
signer.date.position-x=500
signer.date.position-y=642
# Page of the document to sign
signer.page-index-zero-based=3
signer.signature.position-y=640
Using multiple signature files can add an extra level of entropy, reducing the possibility of automated checks rejecting a signature as a duplicate.
- Create a copy of:
files/images/empty-signature.png
- Open it in Preview.
- From the menu bar, click
Tools
->Annotate
->Signature
->Manage Signatures
. - Click
Create Signature
. - Follow the instructions to create a signature.
- Add the signature to the png.
- Expand the signature and crop it to fit.
- Save.