Command-line Interface

User Guide / Getting Started

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

prince [OPTIONS] FILES... [ -o 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.


prince file.xml
Convert file.xml to file.pdf.
prince doc.html -o out.pdf
Convert doc.html to out.pdf.
prince -s style1.css -s style2.css input.xml -o output.pdf
Convert input.xml to output.pdf, applying two user style sheets.
prince doc1.html doc2.html -o out.pdf
Combine doc1.html and doc2.html into a single PDF file, out.pdf.

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 using the -o command line option. 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.


The command line may include the options described below:

General options

-h, --help
Display usage and options.
Display version information.
-v, --verbose
Log informative messages.
Log error messages to a file.

Input options

-i, --input=FORMAT
Set input format [auto | xml | html | html5].
-l, --input-list=FILE
Read input file list from specified file.
Specify the base URL of the input document.
Specify the root directory for absolute filenames.
Disable XInclude processing.

Network options

Disable network access (prevents HTTP downloads).
Specify the username for HTTP authentication.
Specify the password for HTTP authentication.
Specify the HTTP proxy server.
Specify the HTTP timeout in seconds.
Specify a file containing HTTP cookies.
Specify an SSL certificate file.
Specify an SSL certificate directory.
Disable SSL verification (not recommended).

JavaScript options

Enable JavaScript in HTML documents.
Run an external script.

CSS options

-s, --style=FILE
Apply a CSS file.
Specify the media type (eg. print, screen).
Ignore author style sheets.
Ignore default style sheets.

PDF output options

-o, --output=FILE.PDF
Specify the output PDF file.
Attach a file to the PDF.
Disable font embedding in PDF output.
Disable font subsetting in PDF output.
Disable compression of PDF output.

PDF encryption options

Encrypt PDF output.
Set encryption key size [40 | 128].
Set PDF user password.
Set PDF owner password.
Disallow printing of PDF output.
Disallow copying from PDF output.
Disallow annotation of PDF output.
Disallow modification of PDF output.

Utility options

--scanfonts FILES...
Scan font files and create a CSS file.