PDFJAM(1)
π PDFJAM(1) β the manual page, but make it cute
okay bestie, sit down, hydrate, because this is the pdfjam man page and it is actually iconic π
it lives in the User Commands section, and yes we're gonna go through every single flag together. no skipping. periodt.
β¨ NAME β¨
pdfjam β a shell script for manipulating PDF files π¦
β¨ SYNOPSIS β¨
pdfjam [options] [--] [file[pages]]...
β¨ DESCRIPTION β¨
So basically pdfjam takes a whole list of documents β pdf, ps, eps, jpg or png β and assembles them into one single pdf. that's the whole vibe. it lets you rotate, scale, reorder and combine pages freely, using the power of the pdfpages and graphicx LaTeX packages. yes queen, LaTeX is doing the heavy lifting behind the scenes π
Output gets written to a generated name (unless you specify it with --outfile). The input files are embedded as graphics in the output. Especially jpg files are kept as is, without transcoding β no glow-up, no re-encode, just vibes. Input from stdin is supported by specifying /dev/stdin as a file, and stdin is the default if no file is given. lowkey convenient.
By specifying pages you can pick which pages go where and in what order. The default - selects all pages. Example time, bestie:
pdfjam file1 '{},2,4-6,9-' ...
That makes an empty page, followed by pages 2,4,5,6 of file1, followed by pages 9 onwards (up to the end of file1). the {} is the empty page. main character energy.
A page selection can be applied to more than one file, e.g.
pdfjam file1 file2 file3 last-1 ...
which applies the page selection last-1 (reverting the page order) to all three files. But for example
pdfjam file1 file2 2- file3 1-7 ...
would apply the page selection 2- to file1 and file2, and 1-7 to file3. A page selection applies to all the files immediately preceding it in the argument list. it's giving "the pages before me are my problem now" π
See the pdfpages manual for more details on pagespec syntax.
β¨ OPTIONS TO PDFPAGES AND GRAHPICX β¨
Key value options to pdfpages and graphicx can be specified as --key value.
π META OPTIONS π
-h,--helpβ Output this text only; no processing of PDF files.--configpathβ Output theconfigpathvariable and exit immediately; no processing of PDF files.-V,--versionβ Output the version number of pdfjam and exit immediately; no processing of PDF files.-q,--quietβ Suppress verbose commentary on progress. (the chatter? gone. silence. serene. π§)
π₯ PROCESSING OPTIONS π₯
--batchβ Run pdfjam sequentially on each input file in turn, and produce a separate output file for each input, rather than the default coalescing behaviour. For the location of output files, see--outfile. The--batchoption cannot be used in the case of input from stdin.-o,--outfile nameβ Specifies where the output file(s) will go. Ifnameis an existing directory, pdfjam will attempt to write its output PDF file(s) there, with name(s) derived from the input file name(s) and the--suffixoption (see below). Otherwise the output pdf will be written atname.--suffix stringβ Specifies a suffix for output file names, to be used when--outfileis unspecified or a directory. The STRING must not have zero length. (zero length? not on my watch π )--checkfiles,--no-checkfilesβ If the Unixfileutility is available, the output offile -Lb FILE1should bePDF document...where...gives version information. If this is the case on your system you should use--checkfiles; otherwise use--no-checkfiles, in which case all input files must have the correct extensions (.pdf,.ps,.eps,.jpg,.jpeg,.png, or their uppercase variants).--latex pathtolatexβ Specify the LaTeX engine to be used (one ofpdflatex,xelatex,lualatex). The pathtolatex string must be the full path to a suitable LaTeX executable (for example/usr/bin/xelatexon many unix systems).--tidy,--no-tidyβ Specify whether the temporary directory created by pdfjam should be deleted. Use--no-tidyor--builddir(see below) to help debug most errors. (keeping the temp dir is literally the "let me see what went wrong" move π)--builddir pathβ Specifies a build directory to be used in place of a temporary one. Existing files inside will be overwritten. Overrides--tidy.--runs Nβ Run latex N times, for each output document made.--vanillaβ Suppress the reading of any pdfjam configuration files.--encβ Specify a command-line encoding
πΈ PAPER OPTIONS πΈ
--paper papername,--papernameβ Specify a LaTeX paper size, for example--paper a4or simply--a4paperfor ISO A4 paper. A wide range of paper sizes is available thanks to the LaTeXgeometrypackage. For details see documentation for LaTeX and/or thegeometrypackage. If no default value is set, obtain the system's default paper via libpaper, falling back to A4.--papersize width,heightβ Specify a custom paper size in points = 1/72 inch (known as bp in LaTeX and as pt in other software), e.g.--papersize 612,792. Units may also be specified explicitly, e.g.--papersize 10in,18cm.--landscape,--no-landscapeβ Specify landscape page orientation (or not) in the output PDF file.--twoside,--no-twosideβ Specify (or not) thetwosidedocument class option.--other-edge,--no-other-edgeβ Rotate every odd page by 180 degrees (or not). Thus changes along which edge the pages are flipped in duplex printing.--pagecolor rgbspecβ Specify a background colour for the output pages. The RGBSPEC must be a comma-separated triple of integers between 0 and 255. An example:--pagecolor 150,200,150. Default is no background colour.
π PDFINFO OPTIONS π
--keepinfo,--no-keepinfoβ Preserve (or not) Title, Author, Subject and Keywords (from the last input PDF file, if more than one) in the output PDF file. This requires thepdfinfoutility, from the poppler-utils package, and the LaTeXhyperrefpackage; if either of those is not available,--keepinfois ignored. (ngl, it just quietly gives up. relatable.)--pdftitle string,--pdfauthor string,--pdfsubject string,--pdfkeywords stringβ Provide text for the Title, Author, Subject and Keywords in the output PDF file. Requires the LaTeXhyperrefpackage. These options, individually, override--keepinfo.
π ADVANCED OPTIONS π
--preamble stringβ Append the supplied STRING to the preamble of the LaTeX source file(s), immediately before the\begin{document}line to load LaTeX packages or set global options. An example:
pdfjam --nup 2x2 myfile.pdf -o myfile-4up.pdf --preamble '\usepackage{fancyhdr} \pagestyle{fancy}'
If --preamble is used more than once in the call, the supplied preamble strings are concatenated. For a note on avoiding clashes, see the README file, also available at https://github.com/pdfjam/pdfjam.
--β Signals end of options processing.
β PDFPAGES AND GRAPHICX OPTIONS β
--KEY VALUEβ Specify options to\includepdfmerge, in the LaTeXpdfpagespackage. See the the pdfpages documentation (usuallytexdoc pdfpages) for more information. Here KEY is the name of any of the many options for\includepdfmerge, and VALUE is a corresponding value. Examples:--nup 2x1(for 2-up side-by-side imposition)--scale 0.7(to scale all input pages to 70% size)--offset '1cm 0.5cm'(to offset all pages β note the quotes!)--frame true(to put a frame round each input page)--booklet true(to reorder the pages in signatures, generally useful with--nup)--signature N(specify the signature size, as the number of original pages in a signature in the final document. Caveat: booklet is a short form for signature, so if you use--booklet true, signature will be ignored)--trim '1cm 2cm 1cm 2cm' --clip true(to trim those amounts from left, bottom, right and top, respectively, of input pages)--angle NNN(The angle of rotation in degrees. Angles that are not either 0, 90, 180 or 270 will still create straight rectangular pages, only the content will be rotated.)
π«Ά CONFIGURATION FILES π«Ά
Defaults for the options --suffix, --keepinfo, --paper, --outfile, --landscape, --twoside, --tidy, --latex, --runs, --checkfiles and --preamble can be set in site-wide or user-specific configuration files. The files searched are
/etc/pdfjam.conf /usr/share/etc/pdfjam.conf
/usr/local/share/pdfjam.conf /usr/local/etc/pdfjam.conf
$XDG_CONFIG_HOME/pdfjam.conf $HOME/.pdfjam.conf
This list can be changed by editing configpath in the pdfjam script. All of these files are ignored if the --vanilla argument is used.
π AUTHORS π
David Firth (2002 to 2019), Reuben Thomas (2020 to 2024), Markus Kurtz (since 2024)
π SEE ALSO π
The LaTeX packages graphicx (https://ctan.org/pkg/graphicx) and pdfpages (https://ctan.org/pkg/pdfpages). For including eps files, see the epstopdf package (https://ctan.org/pkg/epstopdf).
For more information, including a sample configuration file, see https://github.com/pdfjam/pdfjam.
and that's the whole page, bestie!! πβ¨ this manual is from pdfjam 4.2, dated 2025-01-30, and the page itself is PDFJAM(1). go forth and merge your pdfs, you absolute icon π
ππ¦
π¦ where this page comes from
- alpine 3.24: texmf-dist-binextra-doc 2026.0-r0 Β· LPPL-1.0 AND LPPL-1.1 AND LPPL-1.2 AND LPPL-1.3a AND LPPL-1.3c AND GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms