Command reference¶
pageclerk batch¶
Build one package per row of a data file; each column is a ${variable}.
Usage: pageclerk batch [OPTIONS]
Build one package per row of a data file; each column is a ${variable}.
Options:
-c, --config TEXT Job config file (YAML or TOML); - reads stdin. Optional with --input or
--inputs-from.
--var KEY=VALUE Set a variable; repeatable.
--vars-file PATH Load variables from YAML, JSON or .env.
--set PATH=VALUE Override a config value, e.g. page_numbers.size=10.
--input FILE[:BOOKMARK] Input PDF or image (or a glob); repeatable, in order. Replaces the
config's inputs.
--inputs-from LIST Text file of inputs, one per line: FILE[<TAB>BOOKMARK[<TAB>PAGES]]; -
reads stdin.
--data PATH CSV, JSON or JSON Lines file; one package per row. [required]
--output-dir PATH Folder for the packages. [required]
--jobs INTEGER RANGE Rows built at once (default: CPU count, up to 8). [1<=x<=64]
--where COLUMN=VALUE Only rows where COLUMN equals VALUE; repeatable.
--fail-fast Stop at the first failed row.
--dry-run Validate and plan; write nothing.
--force Overwrite an existing output file.
--deterministic Byte-identical output for identical inputs.
--strict Treat warnings as errors.
--allow-missing-anchors Warn instead of failing when an anchor is not found.
--repair Rebuild inputs that cannot be opened normally.
--license PATH License file (default: $PAGECLERK_LICENSE, ~/.config/pageclerk/license,
/etc/pageclerk/license).
--report PATH Write a JSON report; - writes it to stdout.
-q, --quiet Only print errors.
-v, --verbose More detail on stderr (-v, -vv).
--log-format [text|json] [default: text]
--help Show this message and exit.
pageclerk build¶
Build a PDF package from a job config, --input files or an --inputs-from list.
Usage: pageclerk build [OPTIONS]
Build a PDF package from a job config, --input files or an --inputs-from list.
Options:
-c, --config TEXT Job config file (YAML or TOML); - reads stdin. Optional with --input or
--inputs-from.
--var KEY=VALUE Set a variable; repeatable.
--vars-file PATH Load variables from YAML, JSON or .env.
--set PATH=VALUE Override a config value, e.g. page_numbers.size=10.
--input FILE[:BOOKMARK] Input PDF or image (or a glob); repeatable, in order. Replaces the
config's inputs.
--inputs-from LIST Text file of inputs, one per line: FILE[<TAB>BOOKMARK[<TAB>PAGES]]; -
reads stdin.
-o, --output PATH Output file; overrides output: in the config. - writes to stdout.
--dry-run Validate and plan; write nothing.
--force Overwrite an existing output file.
--deterministic Byte-identical output for identical inputs.
--strict Treat warnings as errors.
--allow-missing-anchors Warn instead of failing when an anchor is not found.
--repair Rebuild inputs that cannot be opened normally.
--license PATH License file (default: $PAGECLERK_LICENSE, ~/.config/pageclerk/license,
/etc/pageclerk/license).
--report PATH Write a JSON report; - writes it to stdout.
-q, --quiet Only print errors.
-v, --verbose More detail on stderr (-v, -vv).
--log-format [text|json] [default: text]
--help Show this message and exit.
pageclerk init¶
Create a ready-to-run example project to learn from and edit.
Usage: pageclerk init [OPTIONS] DIRECTORY
Create a ready-to-run example project to learn from and edit.
Options:
--example [submittal|report|contract|minimal]
Which example project to create. [default: submittal]
--force Write into a folder that already has files.
--help Show this message and exit.
pageclerk inspect¶
Show a PDF's page sizes, rotation, bookmarks, forms and anchors. INPUT - reads stdin.
Usage: pageclerk inspect [OPTIONS] INPUT
Show a PDF's page sizes, rotation, bookmarks, forms and anchors. INPUT - reads stdin.
Options:
--json Print JSON instead of text.
--anchors TEXT Regular expression for anchor text to list. [default:
\[\[[^\[\]\s]{1,80}\]\]]
--password-env NAME Environment variable holding the PDF's password.
--help Show this message and exit.
pageclerk license¶
Show the license status, install a license, and list third-party software.
Usage: pageclerk license [OPTIONS]
Show the license status, install a license, and list third-party software.
Exits with code 8 when there is no valid license, so scripts can check.
Options:
--install PATH Check a license file and install it for this user.
--license PATH Check this license file instead of the installed one.
--full Also print the full third-party license texts.
--eula Print the end-user license agreement.
--json Print the license status as JSON.
--help Show this message and exit.
pageclerk merge¶
Merge PDFs in the order given, with one bookmark per file.
Usage: pageclerk merge [OPTIONS] INPUTS...
Merge PDFs in the order given, with one bookmark per file.
Options:
-o, --output PATH Output file; - writes to stdout. [required]
--bookmarks [filename|title|none]
Bookmark per input, named from its file name or PDF title.
[default: filename]
--existing-bookmarks [keep|nest|drop]
[default: nest]
--title TEXT Document title (metadata).
--forms [flatten|keep] Flatten form fields into the page, or keep them fillable (clashing
names are renamed). [default: flatten]
--dry-run Validate and plan; write nothing.
--force Overwrite an existing output file.
--deterministic Byte-identical output for identical inputs.
--strict Treat warnings as errors.
--allow-missing-anchors Warn instead of failing when an anchor is not found.
--repair Rebuild inputs that cannot be opened normally.
--license PATH License file (default: $PAGECLERK_LICENSE,
~/.config/pageclerk/license, /etc/pageclerk/license).
--report PATH Write a JSON report; - writes it to stdout.
-q, --quiet Only print errors.
-v, --verbose More detail on stderr (-v, -vv).
--log-format [text|json] [default: text]
--help Show this message and exit.
pageclerk number¶
Add page numbers to one PDF (bookmarks are kept).
Usage: pageclerk number [OPTIONS] INPUT
Add page numbers to one PDF (bookmarks are kept).
Options:
-o, --output PATH Output file; - writes to stdout. [required]
--format TEXT Text template, e.g. 'ABC-{n:06}'. [default: Page {n} of {total}]
--position [top-left|top-center|top-right|middle-left|center|middle-right|bottom-left|bottom-center|bottom-right]
[default: bottom-center]
--margin TEXT [default: 0.5in]
--font TEXT Standard PDF font or path to a .ttf file. [default: Helvetica]
--size FLOAT [default: 9.0]
--color TEXT [default: #000000]
--background TEXT Box color behind the number, e.g. #FFFFFF.
--pages TEXT Pages to number, e.g. 2- or 1,3,5-8. [default: all]
--start-at INTEGER [default: 1]
--count-skipped / --no-count-skipped
Whether pages left unnumbered still count toward {n}. [default:
count-skipped]
--dry-run Validate and plan; write nothing.
--force Overwrite an existing output file.
--deterministic Byte-identical output for identical inputs.
--strict Treat warnings as errors.
--allow-missing-anchors Warn instead of failing when an anchor is not found.
--repair Rebuild inputs that cannot be opened normally.
--license PATH License file (default: $PAGECLERK_LICENSE,
~/.config/pageclerk/license, /etc/pageclerk/license).
--report PATH Write a JSON report; - writes it to stdout.
-q, --quiet Only print errors.
-v, --verbose More detail on stderr (-v, -vv).
--log-format [text|json] [default: text]
--help Show this message and exit.
pageclerk prep-signature¶
Turn a JPG/PNG signature into a trimmed PNG with a transparent background.
Usage: pageclerk prep-signature [OPTIONS] IMAGE
Turn a JPG/PNG signature into a trimmed PNG with a transparent background.
Options:
-o, --output PATH Output PNG file. [required]
--threshold INTEGER RANGE Pixels lighter than this become transparent. [default: 200; 1<=x<=255]
--force Overwrite an existing output file.
--help Show this message and exit.
pageclerk stamp¶
Stamp an image (logo or signature) onto one PDF.
Usage: pageclerk stamp [OPTIONS] INPUT
Stamp an image (logo or signature) onto one PDF.
Options:
-o, --output PATH Output file; - writes to stdout. [required]
--image TEXT PNG or JPG to place. [required]
--pages TEXT [default: all]
--position [top-left|top-center|top-right|middle-left|center|middle-right|bottom-left|bottom-center|bottom-right]
Named position on the page.
--rect L,T,R,B Box measured from the top-left, e.g. 1in,1in,3in,2in.
--anchor TEXT Place on this text, e.g. '[[SIG_ENGINEER]]'.
--width TEXT
--height TEXT
--margin TEXT [default: 0.5in]
--opacity FLOAT RANGE [default: 1.0; 0<=x<=1]
--layer [over|under] [default: over]
--remove-anchor-text Cover the anchor with a white box.
--clean-background Treat the image as a signature: remove white paper and trim.
--dry-run Validate and plan; write nothing.
--force Overwrite an existing output file.
--deterministic Byte-identical output for identical inputs.
--strict Treat warnings as errors.
--allow-missing-anchors Warn instead of failing when an anchor is not found.
--repair Rebuild inputs that cannot be opened normally.
--license PATH License file (default: $PAGECLERK_LICENSE,
~/.config/pageclerk/license, /etc/pageclerk/license).
--report PATH Write a JSON report; - writes it to stdout.
-q, --quiet Only print errors.
-v, --verbose More detail on stderr (-v, -vv).
--log-format [text|json] [default: text]
--help Show this message and exit.
pageclerk validate¶
Check a job config, its inputs and placements; write nothing.
Usage: pageclerk validate [OPTIONS]
Check a job config, its inputs and placements; write nothing.
Options:
-c, --config TEXT Job config file (YAML or TOML); - reads stdin. Optional with --input or
--inputs-from.
--var KEY=VALUE Set a variable; repeatable.
--vars-file PATH Load variables from YAML, JSON or .env.
--set PATH=VALUE Override a config value, e.g. page_numbers.size=10.
--input FILE[:BOOKMARK] Input PDF or image (or a glob); repeatable, in order. Replaces the
config's inputs.
--inputs-from LIST Text file of inputs, one per line: FILE[<TAB>BOOKMARK[<TAB>PAGES]]; -
reads stdin.
--strict Treat warnings as errors.
--allow-missing-anchors Warn instead of failing when an anchor is not found.
--repair Rebuild inputs that cannot be opened normally.
--license PATH License file (default: $PAGECLERK_LICENSE, ~/.config/pageclerk/license,
/etc/pageclerk/license).
--report PATH Write a JSON report; - writes it to stdout.
-q, --quiet Only print errors.
-v, --verbose More detail on stderr (-v, -vv).
--log-format [text|json] [default: text]
--help Show this message and exit.