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.
Examples
- 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.
Options
The command line may include the options described below:
General options
- -h, --help
- Display usage and options.
- --version
- Display version information.
- -v, --verbose
- Log informative messages.
- --log=FILE
- Log error messages to a file.
- --log-stats
- Log document statistics. (Removed in Prince 8.0)
Input options
- -i, --input=FORMAT
- Set input format [xml | html | auto].
- --baseurl=URL
- Specify the base URL of the input document.
- --fileroot=DIR
- Specify the root directory for absolute filenames.
- --no-xinclude
- Disable XInclude processing.
Network options
- --no-network
- Disable network access (prevents HTTP downloads).
- --http-user=USER
- Specify the username for HTTP authentication.
- --http-password=PASS
- Specify the password for HTTP authentication.
- --http-proxy=PROXY
- Specify the HTTP proxy server.
- --cookiejar=FILE
- Specify a file containing HTTP cookies.
- --ssl-cacert=FILE
- Specify an SSL certificate file.
- --ssl-capath=PATH
- Specify an SSL certificate directory.
- --insecure
- Disable SSL verification (not recommended).
CSS options
- -s, --style=FILE
- Apply a CSS file.
- --media=MEDIA
- Specify the media type (eg. print, screen).
- --no-author-style
- Ignore author style sheets.
- --no-default-style
- Ignore default style sheets.
PDF output options
- -o, --output=FILE.PDF
- Specify the output PDF file.
- --no-embed-fonts
- Disable font embedding in PDF output.
- --no-subset-fonts
- Disable font subsetting 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.
Utility options
- --scanfonts FILES...
- Scan font files and create a CSS file.