PDFTron logo
 Home | Products | Services | Store | Downloads | Support | Company

PageMaster Command-Line

PDF PageMaster is an affordable industrial strength, stand-alone tool for splitting, merging, editing, and securing PDF files.

Split and combine PDF files

Figure. PDF PageMaster Command-Line Application.

Command-Line syntax for PDF PageMaster Application is as follows:

PDF split: pagemastercmd options file [file ...]
PDF merge: pagemastercmd options file+pages [file+pages ...]

Where options include:

Option Description

-M<file>

Set 'Merge' operation, where <file> is a name of a result file.

-BP<pages>

Set 'Split by Pages' operation, where <pages> is a list of pages separated by commas or a selection of pages. See below for samples illustrating how to use BP parameter.

-BF<n>

Set 'Split by Fragments' operation, where <n> is a size of fragments in KBytes.

-BB<str>

Set 'Split by Bookmarks' operation, where <str> is a list of two bookmarks levels separated by a comma.

-N<path>

Set a path to store new files in split operations. By default new files will be stored in the same directory as original ones.

-DT<str>

Set 'Title' description.

-DA<str>

Set 'Author' description.

-DS<str>

Set 'Subject' description.

-DK<str>

Set 'Keywords' description.

-DC<str>

Set 'Creator' description.

-DP<str>

Set 'Producer' description.

-DR<date>

Set 'Created' date, where <date> is a string of the form D:YYYYMMDDHHmmSSOHH'mm'.

-DM<date>

Set 'Modified' date, where <date> is a string of the form D:YYYYMMDDHHmmSSOHH'mm'.

-S<n>

Set security (0 - do not change current security,
1 - remove security, 2 - 40 bit, 3 - 128 bit).

Default value '-S0'.

-RA<n>

Set all document's restrictions (0 - not allowed, 1 - allowed).

Default value '-RA1'.

-RP<n>

Set 'Printing' restriction (0 - not allowed, 1 - low resolution, 2 - high resolution). Default value depends on '-RA<n>' switch.

-RD<n>

Set 'Changing the Document' restriction (0 - not allowed, 1 - allowed). Default value depends on '-RA<n>' switch.

-RS<n>

Set 'Document Assembly' restriction (0 - not allowed, 1 - allowed). Default value depends on '-RA<n>' switch.

-RE<n>

Set 'Content Copying or Extraction' restriction (0 - not allowed, 1 - allowed). Default value depends on '-RA<n>' switch.

-RX<n>

Set 'Content Extraction for Accessibility' restriction
(0 - not allowed, 1 - allowed). Default value depends on '-RA<n>' switch.

-RC<n>

Set 'Commenting' restriction (0 - not allowed, 1 - allowed). Default value depends on '-RA<n>' switch.

-RF<n>

Set 'Filling of form fields' restriction (0 - not allowed,
1 - allowed). Default value depends on '-RA<n>' switch.

-P<pass>

Set a password for processing protected files.

-Q<n>

Ask for a password during the processing protected files. (0 - not, 1 - yes). Default value '-Q1'.

-U<pass>

Set new user password.

-W<pass>

Set new owner password.

where 'file' specifies a valid directory or path and file-name that can contain wildcard characters (* and ?).

'file+pages' specifies a valid directory or path and file name followed by a selection of pages to be extracted/merged.

Examples of 'file+pages' parameter:

Example Description

myfile.pdf,1,7,3

add page 1, page 7, and page 3 to the output file

myfile.pdf,1-10

add pages 1 to 10 to the output file

myfile.pdf,10-1

add pages 1 to 10 in reverse order to the output file

myfile.pdf,4-

add pages from 4 to the last one from the source file to the output file

myfile.pdf,4-e

add all even pages from the source file starting from
page 4 to the output file

myfile.pdf,-10d

add odd pages between page 1 and page 10 to the output file

myfile.pdf,e

add all even pages to the output file

myfile.pdf,d

add all odd pages to the output file

4-e

Extract all even pages in the page range from 4 to the last page.

-10d

Extract all odd pages in the page range 1-10.

x2

Split the document into a list of documents each containing two pages.

x3

Split the document into a list of documents each containing three pages.

dx4

Extract all odd pages into a list of documents each containing four pages.

-BP<pages> option format

<pages> ::= [ <parameter> { ',' <parameter> } ]
<parameter> ::= <selection> [ <attribute> {<attribute>} ] |
<attribute> {<attribute>}
<selection> ::= <page> | <page> '-' [ <page> ] | '-'<page>
<page> ::= <digit> { <digit> }
<attribute> ::= 'e' | 'd' | 'x' <x_number>
<x_number> ::= '2' | '3' | '4' | ...

Examples of -BP parameter:

Example Description

-BP1,7,3

create 3 files containing page 1, page 7, and page 3 from the source file

-BP1-10

create 1 file containing pages 1 to 10 from the source

-BP10-1

create 1 file containing pages 1 to 10 from the source in reverse order

-BP4-

extract pages from 4 to the last one

-BP4-e

extract only even pages from 4 to the end

-BP-10d

extract odd pages between page 1 and page 10

-BPx2

split the source file into the files containing 2 pages each

-BPe

extract all even pages and puts them into the one file

-BPdx3

extract all odd pages and puts them into the output
files by 3 pages each

-BB<str> option format

<str> ::= <bookmark_from> ',' <bookmark_to>
<bookmark_from> ::= <digit> { <digit> }
<bookmark_to> ::= <digit> { <digit> }


Examples:

pagemastercmd -BP1,3,5 myfile1.pdf myfile2.pdf
pagemastercmd -Mnewfile.pdf -puserpass myfile1.pdf,1,3 myfile2.pdf,2,4


Name generation rules

Split operations use following rules to generate new file names.

If destination file contains one page:

1. Get the source file name.
2. Add '_' character.
3. Add the number of the page in the destination file.

If destination file contains two and more pages:

1. Get the source file name.
2. Add '_' character.
3. Add the number of the first page in the destination file.
4. Add '-' character
5. Add the number of the last page in the destination file.

If 'e'(even pages) or 'd'(odd pages) parameters specified in the operation then following rule apply:

1. Get the source file name.
2. Add '_' character.
3. Add the parameter string as is.
4. If the first page number is missing then use '1' as a first page number.
5. If the last page number is missing then use '9999' as a last page number.

If 'e' or 'd' is used in combination with 'x' parameter then following rule apply:

1. Get the source file name.
2. Add '_' character.
3. Add the number of the first page in the destination file.
4. Add '-' character
5. Add the number of the last page in the destination file.
6. Add 'e' of 'd' character accordingly.

PDF split & merge
 Product Info 
 User Manual 
 Command Line 
 Get the Demo! 
 Buy Online