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.
Specify the PDF profile to use.
Attach a file to the PDF.
Disable synthesis of missing bold/italic fonts.
Disable font embedding in PDF output.
Disable font subsetting in PDF output.
Disable compression of PDF output.

PDF Metadata Options

Set PDF document title.
Set PDF document subject.
Set PDF document author.
Set PDF document keywords.
Set PDF document creator.

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.