Command-line Interface

Prince may be called from the command-line with the following arguments:

prince [OPTIONS] XML [PDF]

Please note that on Windows, Prince can be called from the command-line by running the prince.exe file found in the Prince\Engine\bin folder of the Prince installation.

Examples

prince FILE.XML
Prints FILE.XML to a PDF file (FILE.PDF)
prince INPUT.XML OUTPUT.PDF
Prints INPUT.XML to OUTPUT.PDF.
prince -s STYLE1.CSS -s STYLE2.CSS INPUT.XML OUTPUT.PDF
Prints INPUT.XML to OUTPUT.PDF, applying two user style sheets.

Specifying input and output

The command line must contain the name of the input file to process. An input filename consisting of a single hyphen "-" will cause Prince to read from the standard input stream.

The output file name can be specified on the command line after the input file name. An output filename consisting of a single hyphen "-" will cause Prince to write to the standard output stream.

If the output file name is omitted, the output will be placed in a file with the same name as the input, but with a PDF file extension.

Options

The command line may include the options described below:

General options

-s, --style=CSS
Apply a Cascading Style Sheet.
-i, --input=FORMAT
Set input format [xml | html | auto].
-h, --help
Display usage and options.
--version
Display version information.
-v, --verbose
Log informative messages.
--log=FILE
Log error messages to a file.
--baseurl=URL
Specify the base URL of the input document.
--no-xinclude
Disable XInclude processing.

PDF output options

--no-embed-fonts
Disable font embedding in PDF output.
--no-compress
Disable compression of PDF output.

PDF encryption options

--encrypt
Encrypt PDF output.
--key-bits=NUM
Set encryption key size [40 | 128].
--user-password=PASS
Set PDF user password.
--owner-password=PASS
Set PDF owner password.
--disallow-print
Disallow printing of PDF output.
--disallow-copy
Disallow copying from PDF output.
--disallow-annotate
Disallow annotation of PDF output.
--disallow-modify
Disallow modification of PDF output.