id = "pdfjam" name = "pdfjam" homepage = "https://github.com/pdfjam/pdfjam" description = "A shell-script interface to the \"pdfpages\" LaTeX package." # The script's own header line, verbatim. executables = ["pdfjam"] platforms = ["macos", "linux"] [dotfiles] # pdfjam(1), Configuration Files: the settings built into the script "are # over-ridden by any that are found at a site-wide configuration file (at # /etc/pdfjam.conf, /usr/share/etc/pdfjam.conf, /usr/local/share/pdfjam.conf, # or /usr/local/etc/pdfjam.conf), which in turn are over-ridden by any that are # found in a user-defaults file at ~/.pdfjam.conf." # # The script itself adds a second user location above that one: # configpath="$configpath:${XDG_CONFIG_HOME:-$HOME/.config}" # configFiles=$(printf "%s" "$configpath" | # sed 's/:/\/pdfjam.conf:/g; s/$/\/pdfjam.conf/') # configFiles="${configFiles}:$HOME/.pdfjam.conf" # so $XDG_CONFIG_HOME/pdfjam.conf — the file sits directly in the config # directory, not in a pdfjam/ subdirectory — is read as well, and it reads the # variable, hence [configHome]. Both spellings are listed; a consumer skips the # one that is absent. paths = [ "~/.pdfjam.conf", "[configHome]/pdfjam.conf", ] exclude = [] secret = [] # Read once per invocation, by a script that then exits. side_effect = false # The script's Defaults block lists what a conf file may set: paper, suffix, # keepinfo, landscape, twoside, tidy, runs, builddir, enc, preamble — and the # four it fills in by locating programs on this machine, # latex=$(command -v pdflatex) # pdfinfo=$(command -v pdfinfo) # iconv=$(command -v iconv) # plus the legacy spelling it still honours, `if [ -n "${pdflatex:-}" ]; then # latex="$pdflatex"; fi`. Setting any of those in a conf file pins an absolute # path to a binary in this machine's TeX installation, which the next machine # will not have; builddir names a scratch directory on this disk. Everything # else in the file is a preference about the output. [[dotfiles.machine_lines]] file = ["~/.pdfjam.conf", "[configHome]/pdfjam.conf"] match = { prefix = ["latex=", "pdflatex=", "pdfinfo=", "iconv=", "builddir="] } [commands] format = 1 label = "Combine or impose PDF pages" description = "Run pdfjam on one or more PDF files to produce a single output file: n-up layout, scaling, orientation and paper size. Page selections and other pdfpages keys are left out." quality = "ai-draft" parser = { end_of_options = "--", interleave = "permute", long_equals = false, short_attached = false, short_bundles = false } [[commands.source]] id = "help" kind = "help" revision = "pdfjam --help" evidence = """ Usage: pdfjam [OPTIONS] [--] [FILE1 [SEL1]] [FILE2 [SEL2]]... --outfile PATH (or -o PATH) --suffix STRING --landscape --no-landscape --paper PAPERSPEC (or simply --PAPERSPEC) --quiet (or -q) --nup 2x1 (for 2-up side-by-side imposition) --scale 0.7 (to scale all input pages to 70% size) --offset '1cm 0.5cm' --frame true (to put a frame round each input page) --trim '1cm 2cm 1cm 2cm' --clip true """ [[commands.field]] id = "files" label = "Input PDF files" type = "path" position = 0 multiple = true min = 1 path = { kind = "file", role = "input", must_exist = true } sources = ["help"] [[commands.field]] id = "outfile" label = "Output file" type = "path" option = ["--outfile", "-o"] path = { kind = "any", role = "output" } effect = "overwrite" sources = ["help"] [[commands.field]] id = "nup" label = "Pages per sheet (n-up)" description = "For example 2x1 or 2x2." type = "string" option = ["--nup"] suggestions = [{ value = "2x1", label = "2 side by side" }, { value = "2x2", label = "4 per sheet" }] sources = ["help"] [[commands.field]] id = "scale" label = "Scale" description = "For example 0.7 scales pages to 70%." type = "number" option = ["--scale"] sources = ["help"] [[commands.field]] id = "paper" label = "Paper size" type = "string" option = ["--paper"] suggestions = [{ value = "a4paper", label = "A4" }, { value = "letterpaper", label = "US Letter" }] sources = ["help"] [[commands.field]] id = "landscape" label = "Landscape" type = "boolean" option = ["--landscape"] false_option = "--no-landscape" sources = ["help"] [[commands.field]] id = "frame" label = "Frame around each page" type = "enum" option = ["--frame"] choices = [{ value = "true", label = "Yes" }, { value = "false", label = "No" }] sources = ["help"] [[commands.field]] id = "suffix" label = "Output suffix" description = "Used when the output is a directory." type = "string" option = ["--suffix"] sources = ["help"] [[commands.field]] id = "quiet" label = "Quiet" type = "boolean" option = ["--quiet", "-q"] sources = ["help"] [[commands.task]] id = "nup" label = "N-up layout" fields = ["files", "outfile", "nup"] required = ["files", "outfile", "nup"] [[commands.task]] id = "merge" label = "Concatenate PDFs" fields = ["files", "outfile"] required = ["files", "outfile"] [[commands.group]] id = "basic" label = "Basic" fields = ["files", "outfile", "nup", "paper", "landscape"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["scale", "frame", "suffix", "quiet"]