12-31 -dividePdf: Splitting a PDF File

Processing

Splits the input file according to the specified conditions.

Note:

  • One of -each, -into, -outline is required. if not specified, an error will occur. Also, if multiple parameters are specified at the same time, all parameters other than the first specified will be ignored.
  • Don't forget the extension when specifying the full path of the file with -o. If you do not add an extension, the file with the suffix added to the file name will be output without an extension.

Example of commands

[Executing example commands]

Splits test.pdf into 5 pages each and outputs them to the out folder.

  • Specify the output file name in the format of the input file name plus the serial number.

[Windows]

AHPDFToolCmd80.exe -dividePdf -each 5 -suffix 2 -d c:\in\test.pdf -o c:\out

[Linux]

AHPDFToolCmd80 -dividePdf -each 5 -suffix 2 -d /home/antenna/in/test.dpf -o /home/antenna/out

Folder settings: not applied

Although it is not possible to specify a folder for the input file, it is possible to specify a folder with -o, which specifies the output file. In that case, the PDF will be split into the folder specified by the output file name with a suffix added to the input file name.

Parameters

[One of -each, -into, -outline is required]

Parameter

Content

-each <Val>

Splits the file by specified number of pages with <Val>.

-into <Val>

Splits the file into the specified number of files with <Val>.

If the file cannot be split into the specified number of files, the original file name is output without the suffix.

-outline

Splits the file by first layer of bookmarks.

If bookmarks do not exist, outputs the original file name without adding a suffix.

-suffix {1 | 2 | 3 | 4 | 5}

Sets the output file name suffix. Default value is "1." An error occurs if "-suffix {3|4|5}" is specified when "-outline" is not specified.

1: Adds a split page range. The starting number of the page is "1." Expresses the number of digits of the total number of pages and pads with zeros.

2: Adds serial numbers. The starting serial number is "1." Expresses the number of digits to be split and pads with zeros.

3: Uses the bookmark title as the file name. Effective only when "-outline" is specified.

4: Uses the page range + bookmark title as the file name. The starting number of the page is "1." Effective only when "-outline" is specified.

5: Uses serial number + bookmark title as file name. The starting serial number is "1." Effective only when "-outline" is specified.

Note:
If "-each", "-into", and "-outline" are specified at the same time, the file will be split based on the condition of the first appeared parameter of the command string.

Please enter alt text.