Signatures and anchors¶
Put a short, unique piece of text in your document where a signature belongs,
such as [[SIG_ENGINEER]], and PageClerk places the signature on it. Write
anchors in white or tiny text in your templates, so they are invisible even
when not replaced. pageclerk inspect file.pdf lists the anchors it finds.
version: 1
output: out.pdf
inputs: [{file: approval.pdf}]
signatures:
- image: signature.jpg # a phone photo or scan
anchor: "[[SIG_ENGINEER]]"
width: 2in
offset: [0, 2pt]
clean_background: true # paper removed, trimmed, one ink colour
remove_anchor_text: true # cover the anchor with a white box
caption: "${engineer} - {date}"
caption_offset: [0, -16pt] # move the caption below a printed label
- The image is aligned to the anchor's box:
alignleft/center/right,valignbottom/middle/top, thenoffset. Withoutwidthorheightit takes the anchor's width. on_multiple: all | first | errordecides what happens when the anchor appears more than once.pageslimits the search.- A missing anchor stops the build with exit code 6, unless
--allow-missing-anchors(oroptions: {allow_missing_anchors: true}). pageclerk prep-signature signature.jpg -o signature.pngdoes the cleanup once, if you prefer to keep a transparent PNG.
Stamps can use anchors too, and signatures can use position or rect like
stamps.