Introduction

This appendix describes the apsplit command syntax and summarizes the options you can use with the apsplit command.

The examples in this appendix assume that you are running apsplit on the command line from the directory in which it was installed. Windows notation is used. If you are a UNIX or Macintosh user, make the appropriate substitutions.

Command Syntax

apsplit [options] inPDFFile1 [inPDFFile2 ...]

Product Information Options

The following table describes options you can use to obtain information about the APSplit product. For more information about these options, see Getting Started with APSplit.

Option Function Description Example
-v Show version information Displays the version of APSplit you are running. This is important when corresponding with support@Appligent.com. In order to best understand your problem, we must know what version of the software you have. apsplit -v
-h or
-help
Show help Displays all available command-line options, plus version information. apsplit -h

apsplit -help

Input and Output Options

The following table describes options for managing file input and output. For more information about the -o and -d options, see Performing a Basic Split and Performing Custom Splits The -keepannots and -w options are described in Tailoring the Output.

 

Option Function Description Example
-d <string> Owner password to open this document The Owner password of a secured PDF file. The Owner password, also known as the Master password or Permissions password, is required if the PDF file you are splitting is secured. It allows you to modify and save the file. apsplit -d password
[options]-o path\outdirectory\
path\input.pdf
-o <string> Output filename Specifies a file or directory name to be used for the output. Some split options require a file name, others require a directory name, and others accept either. (The basic default split, which does not specify any split options, accepts either a file or directory name.) apsplit [options]
-o path\outdirectory\
path\input.pdfapsplit [options] -odd
-o path\output.pdf
path\input.pdf
-keepannots Retain the page annotations Saves page annotations in output documents. (The default behavior is to delete annotations.) apsplit -keepannots
-o path\outdirectory\
path\input.pdf
-w Linearize the file upon save Linearizes multi-page files for more efficient web delivery. Individual pages can be rendered before the entire document has downloaded, so the user can start reading the document sooner. apsplit [options] -w
-o path\outdirectory\
path\input.pdf

Split Options — By Section

The following table describes the options you can use to extract sections from a document based on first-level bookmarks, odd pages, or even pages. For more information about these options, see Performing Custom Splits.

 

Option Function Description Example
-bybookmarks Split document by highest level bookmarks Breaks up one or more PDF documents based on first-level bookmarks. Each first-level bookmark section is extracted to its own file.
Input: One or more PDF files
Output (-o option):   If there is one input document, a file or directory name.
If there are multiple input documents, a directory name.
apsplit -bybookmarks
-o path\outdirectory\
path\input.pdf
-odd Split out odd pages Extracts all of the odd-numbered pages from a document. For example, in a document with 6 pages, 1, 3, and 5 are extracted.
Input: One PDF file.
Output (-o option): A file name.
apsplit -odd
-o path\output.pdf
path\input.pdf
-even Split out even pages Extracts all of the even-numbered pages from a document. For example, in a document with 6 pages, pages 2, 4, and 6 are extracted.
Input: One PDF file.
Output (-o option): A file name.
apsplit -even
-o path\output.pdf
path\input.pdf

Split Options — By Page Range

The following table describes the options you can use to extract specific page ranges from a document. For more information about these options, see Splitting by Page Range.

Option Function Description Example
-startpage
<integer>
The first page in the range to extract. Requires -endpage.  -repeat is optional Specifies the first page number in a range to be extracted to a PDF file. For example, a -startpage of 3 indicates that page 3 will be the first page in the range.

Input: One or more PDF files.
Output (-o option):
When used with -endpage alone:
A file or directory name if there is one input document.
A directory name if there are multiple input documents.
When used with -endpage and -repeat, a directory name.

apsplit -startpage 3
-endpage 7
-o path\output.pdf
path\input.pdf
-endpage
<integer>
The last page in the range to extract. Requires -startpage. -repeat is optional Specifies the last page number in a range to be extracted to a PDF file. For example, an -endpage of 7 indicates that page 7 will be the last page in the range.

Input: One or more PDF files.
Output (-o option):
When used with -startpage alone:
A file or directory name if there is one input document.
A directory name if there are multiple input documents.
When used with -startpage and -repeat, a directory name./

apsplit -startpage 3
-endpage 7
-o path\output.pdf
path\input.pdf
-repeat
<integer>
Repeat the extract of the given page count for the specified number of iterations. Indicates how many times to extract the number of pages specified using the -startpage and -endpage options. For example, a -startpage of 3 and -endpage of 7 indicate that 5 pages are to be extracted, beginning with page 3 and ending with page 7. If the -repeat is 20, pages 3-7 are extracted to one PDF file, pages 8-12 are extracted to a second PDF file, pages 13-17 are extracted to a third PDF file, and so on for a total of 20 extractions, up to the maximum number of pages in the file.
Input: One or more PDF files.
Output (-o option): A directory name.
apsplit -startpage 3
-endpage 7 -repeat 20
-o path\outdirectory\
path\input.pdf
-list
<filename>
File containing a comma-separated list of page ranges and output file names Extracts multiple page ranges based on the values in the specified list text file. Each line in the file must contain a start page, end page, and output file name in comma-separated format. The last valid line must end with a carriage return. The following line may contain a carriage return but no other characters.

Sample TextFile (list.txt)
1,4,Section.1.pdf
5,8,Section.2.pdf
Input: A file name.

apsplit -list
path\list.txt
path\input.pdf

Options — By File Size

The following table describes the options you can use to split a document based on the desired output file size. For more information about these options, see Splitting By File Size.

Option Function Description Example
-byfilesize Split by maximum file size.  Requires -maxsize and -maxcount Splits one or more PDF files based on the maximum output file size (-maxsize) and maximum page count (-maxcount).
Input: One or more PDF files.
Output (-o option):
If there is one input document, a file, or directory name.
If there are multiple input documents, directory name.
apsplit -byfilesize
-maxsize 500
-maxcount 20
-o path\outdirectory\
path\input.pdf
-maxsize
<integer>
The maximum file size in kilobytes The maximum size, in kilobytes (KB), of each output file to be extracted in a split by file size. The maximum file size is limited by the maximum page count.

Note: When a single page is larger than the -maxsize, it is split out as one file. APSplit does not break pages into fractional components.

apsplit -byfilesize
-maxsize 500
-maxcount 20
-o path\outdirectory\
path\input.pdf
-maxcount
<integer>
The maximum number of pages in the document when splitting by file size The maximum number of page to be extracted to each output file in a split by file size. The maximum page count takes precedence if it is reached before the maximum file size.
For example, assume a maximum file size of 500 KB and a maximum page count of 20. Even if 25 pages are required to reach a file size of 500 KB, only 20 pages are extracted.
apsplit -byfilesize
-maxsize 500
-maxcount 20
-o path\outdirectory\
path\input.pdf

Reporting Options

The following table describes the options for reporting progress and error messages. These options are helpful for debugging and understanding how APSplit works. For more information about these options, see Reporting Progress and Errors – APSplit.

 

Option Function Description Example
-p Show progress Write progress messages to the screen (STDOUT— the standard output of your system). This option is helpful for debugging and for understanding how the software works. apsplit -p [options]
-o path\outdirectory\
path\input.pdf
-l <logfile> Write progress and error messagesto the given log file name Saves the progress and error messages to a user-specified text file instead of the default log file, apsplit.log. The name of the text file must directly follow the -l option. (By default, APSplit writes any error messages to the screen, STDOUT, and to the default log file, apsplit.log)

Note: If the log file you specify is a read-only file, a warning is displayed and nothing is written to the log file. Make sure that your log file is write-enabled.

apsplit -l path\mylogfile.txt
[options]
-o path\outdirectory\
path\input.pdf
-p and -l combined Write progress and error messages to the given log file name If the -p and -l options are both specified, progress and error messages will be written to the file that you specify. apsplit -p -l
path\mylogfile.txt
[options]
-o path\outdirectory\
path\input.pdf

Registration Number

The following table describes how to supply the registration number to APSplit.

Note: Do not call the apsplit script from another script or application. Call apsplitapp directly, as shown in the example below.

Option Function Description Example
-r <RegNum> Pass APSplit registration number This option can be used to supply your registration number to APSplit from a script or another application. This option is typically not necessary and is available for use in cases where the Appligent License File can not be located by the application because of runtime environment restrictions. apsplitapp -r
XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
[other options]
-o path\outdirectory\
path\input.pdf