13–31 -dividePdf: Splitting a PDF File

13–31–1 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.

13–31–2 Example of commands

[Executing example commands]

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

[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

13–31–3 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.

13–31–4 Parameters

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

Parameter
Content
-each [Number of pages]
Splits the file by specified number of pages
-into [Number of files]
Splits the file into the specified number of files.
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.