12-4 -mergeFiles: Merging PDF files

Processing

Merges multiple PDF files into one file. Specify multiple input PDF files using -d.

Note:

  • Annotations and outline titles are preserved when merging entire files. However, if there is a PDF that specifies pages to be merged, the outlines of that input file will not be retained.
  • If the first specified input file does not have page settings, the document information of the first input file will be carried over to the output PDF file.
  • If the first specified input file has page settings, the document information value of the output PDF file will be empty.
  • The security information of the input file is not carried over to the output PDF file.
  • If the output PDF file size exceeds 2GB, an error will occur when saving. Antenna House PDF API's merging process does not physically combine PDF files, so an error may occur even if the total file size before merging is less than 2GB.

Example of commands

[Executing example commands]

Merges two input files, test1.pdf and test2.pdf and outputs it.

  • The output PDF is optimized for web display and output as out.pdf.
  • When specifying the input file, test1.pdf adds the entire file, and test2.pdf adds the 1st page and pages 10 to 15 as the output PDF.
  • When opening test2.pdf, the user password "userpass" is entered.

[Windows]

AHPDFToolCmd80.exe -mergeFiles -d C:\test\test1.pdf -d C:\test\test2.pdf userpass "0,9-14" -o C:\sav\out.pdf -linearize

[Linux]

AHPDFToolCmd80 -mergeFiles -d /home/antenna/test/test1.pdf -d /home/antenna/test/test2.pdf userpass "0,9-14" -o /home/antenna/sav/out.pdf -linearize

Folder settings: not applied

Parameters

Parameter

Content

-dmerge <path>

Merges the PDF files described in the text file specified in <path> in order from the first line.

Specify the full path name in <path>.

If it is specified at the same time as "-d", an error will occur.

How to write a text file: Write one file path per line. Use "UTF-8" as the character encoding.

-copyAnnots {true | false}

Specifies whether to copy annotations when merging files.

true: Copies it.
false: Does not copy it.

If not specified, copies it.

-copyOutlines {true | false}

Specifies whether to copy outlines when merging files.

true: Copies it.
false: Does not copy it.

If not specified, copies it. However, if you specify pages to be merged, they will not be copied.

Please enter alt text.