LinuxCommandLibrary

pdfjoin

Merge multiple PDF files into one

TLDR

Merge two PDFs into one with the default suffix "joined"

$ pdfjoin [path/to/file1.pdf] [path/to/file2.pdf]
copy

Merge the first page of each given file together
$ pdfjoin [path/to/file1.pdf path/to/file2.pdf ...] [1] --outfile [output_file]
copy

Save pages 3 to 5 followed by page 1 to a new PDF with custom suffix
$ pdfjoin [path/to/file.pdf] [3-5,1] --suffix [rearranged]
copy

Merge page subranges from two PDFs
$ pdfjoin [/path/to/file1.pdf] [2-] [file2] [last-3] --outfile [output_file]
copy

SYNOPSIS

pdfjoin [options] [input1.pdf input2.pdf ...]

PARAMETERS

--a4paper
    Use A4 paper size.

--letterpaper
    Use Letter paper size.

--landscape
    Rotate the PDF pages to landscape mode.

--outfile
    Specify the output filename.

--fitpaper
    Scale pages to fit the paper size (default: true).


    Specify particular pages from the input PDF file to use (e.g., 'document.pdf 1-3,5').

DESCRIPTION

The pdfjoin command is a versatile tool used to merge or concatenate multiple PDF files into a single PDF document. It is part of the PDFjam package and provides a straightforward way to combine PDFs without requiring complex PDF editing software. pdfjoin can handle various input formats and allows for customization of the output, such as specifying page ranges from input files. It's commonly used for creating unified documents from separate reports, presentations, or scanned images. The order of the input files determines the order of pages in the output PDF. This tool is essential for document management and archiving, streamlining the process of combining individual PDFs into cohesive documents for easier access and distribution.

CAVEATS

pdfjoin relies on the PDFjam package being installed. Ensure that the package is correctly installed before using the command. Also, complex or heavily formatted PDFs might not merge perfectly, and manual adjustments may be required in some cases. The command does not offer extensive PDF editing features beyond merging.

PAGE RANGES

The page ranges are specified using the following notation: n for a single page, n-m for a range of pages from n to m, and multiple ranges can be separated by commas (e.g., 1-3,5,7-9).

SEE ALSO

Copied to clipboard