The pdf-merge command allows you to merge multiple PDF documents or specific page ranges from them via the terminal. You can specify input files and use a # suffix to define page ranges.
Command Syntax:
pdf-merge [options] <inputFiles...>
Options:
-V, --version: Output the version number.-o, --output <outputFile>: Path for the merged PDF output file.-v, --verbose: Print verbose output.-s, --silent: Do not print any output to stdout (overwrites --verbose).-h, --help: Display help for the command.
Examples:
Merge pages 1-2 from the first input with pages 1, 2, and 5-7 from the second PDF:
pdf-merge --output ./merged.pdf ./input1.pdf#1-2 ./input2.pdf#1,2,5-7
Merge files from URLs (merging a local file with specific pages from a remote URL):
pdf-merge --verbose --output ./sample.pdf Testfile.pdf https://pdfobject.com/pdf/sample.pdf https://upload.wikimedia.org/wikipedia/commons/1/13/Example.pdf#2-3