afpsplit utility: extracts pages from a MO:DCA-P file

Syntax

afpsplit [-f page] [-p page] [-r ranges] [-o OutputFile] [InputFile]

Description

Enter the afpsplit command to extract a page or a range of pages from an AFP MO:DCA-P document and create MO:DCA-P output.

You might use the afpsplit command to create a separate file starting at the 25th page and ending at the 50th page of a 200-page document. After you use the afpsplit command to create a file, you can view, store, print, or send that file.

    Note:
  1. afpsplit removes structured index fields from MO:DCA-P files. This does not affect the appearance of printed files, but index entries are no longer available for viewing.
  2. afpsplit writes error messages to STDERR.

Flags

-f page
Specifies the forward space function, where page indicates the number of pages (0-999999999) that you can forward space from the beginning of the input file to start extracting the page or range of pages. To start extracting on page n, forward space n-1 pages.

If you do not specify the -f flag, the extraction starts at the beginning of the file. If you specify more than one -f flag, the last one you specify is used.

-p page
Specifies the page end function, where page indicates the number of pages (0-999999999) to be extracted.

If you do not specify the -p flag, all pages from the forward space point to the end of the input file are included in the output file. If you specify more than one -p flag, the last one you specify is used.

-r ranges
Specifies the page ranges that can be extracted from the input file, where the ranges syntax is -rs1:e1,s2:e2, si is the start value and ei is the end value of the i interval. Up to 10 intervals can be specified with this flag. The intervals must not overlap. The delimitator between start and end value is ‘:’. The delimitator between page ranges is ‘,’. If no start value is specified for an interval, the first page is considered as start value. If no end value is specified for an interval, 999999999 is considered as end value. There must be at least one valid interval for the -r flag to work properly. The intervals are sorted ascending internally. This flag cannot be used in combination with -f and -p flag.
-o OutputFile
Specifies the name of the file for the page or range of pages produced by afpsplit.

If you do not specify this flag, afpsplit uses standard output (STDOUT).

Argument

The valid argument value for the afpsplit utility is:

InputFile
Specifies the input file.

If you do not specify an input file, afpsplit uses standard input (STDIN).

Example

To extract pages 21-30 from a MO:DCA-P input file called input.afp and use the pdpr command to print those 10 pages on printer serv1-lp, enter:

afpsplit -f 20 -p 10 input.afp | pdpr -p serv1-lp

Example with -r flag

Consider the input file has 100 pages.

This instance extracts pages 10 to 14, 20 to 30 and 80 to 100 to the output_file.afp:

afpsplit -r10:14,20:30,80: -o output_file.afp input_file.afp 

This instance extracts pages 1 to 10 (from interval “:10”), 30 to 40 and 90 to 100 (from interval “90:112”) to the output_file.afp. The last interval is discarded, since it exceeds the maximum number of pages in the input file:

apfsplit -r30:40,:10,90:112,130:140 -o output_file.afp input_file.afp

These instances generate an error because there is not at least one valid interval or the intervals overlaps:

afpsplit -r101:104,120:140,160: -o output_file.afp input_file.afp
afpsplit -r10:14, 40:,12:20 -o output_file.afp input_file.afp