PRINCE(1)

NAME
prince - convert XML and HTML to PDF

SYNOPSIS
prince [options] FILES... [ -o PDF ]

DESCRIPTION
Prince is a batch formatter for converting XML and HTML into PDF. Prince has strong support for Cascading Style Sheets (CSS). Prince prints any XML document without relying on proprietary markup.

OPTIONS

-h, --help
    Display usage and options.

--version
    Display version information.

--credits
    Display credits and acknowledgements.

  LOGGING OPTIONS

-v, --verbose
    Log informative messages.

--debug
    Log debug messages.

--log=FILE
    Append log messages to a file.

--no-warn-css
    Do not warn about CSS (implies the following).

--no-warn-css-unknown
    Do not warn about unknown CSS features.

--no-warn-css-unsupported
    Do not warn about unsupported CSS features.

--structured-log=TYPE
    Enable structured logging on stderr. [normal|quiet|progress|buffered]

  INPUT OPTIONS

-i, --input=INPUT
    Set input format. [xml|html|markdown|auto]

-l, --input-list=FILE
    Read multiple input filenames from another file. This option can be used multiple times.

--job=FILE
    Read job description from the specified JSON file.

--baseurl=URL
    Specify the base URL of the input document.

--remap=URL=DIR
    Map a http(s) URL to a path so that network resources matching the scheme, host, port and path prefix will be loaded from the given directory. This option can be used multiple times.

--fileroot=DIR
    Specify the root directory for absolute filenames. Deprecated in favour of --remap.

--iframes
    Enable loading of HTML iframes.

--markdown-superscript
    Enable superscript syntax in Markdown input. When enabled, carets (^text^) produce superscript (<sup>).

--markdown-subscript
    Enable subscript syntax in Markdown input. When enabled, single tildes (~text~) produce subscript (<sub>) instead of strikethrough. Double tildes (~~text~~) still produce strikethrough.

--no-markdown-smart-typography
    Disable smart typography in Markdown input. By default, Prince converts straight quotes to curly quotes, -- to an en-dash (–), --- to an em-dash (—), and ... to an ellipsis (…). This option disables that behavior.

--no-markdown-math
    Disable automatic math rendering in Markdown input. By default, Prince renders math notation written with dollar signs ($...$ for inline, $$...$$ for display) using KaTeX. This option disables that behavior.

--xinclude
    Enable XInclude processing. Implies --xml-external-entities.

--xml-external-entities
    Enable loading of XML external entities (XXE) and external DTD subsets.

--xml-parse-huge
    Relax hardcoded limits in the XML parser. Depending on the version of libxml2 being used, it might be necessary to enable this option to load larger XML documents. However, doing so may leave the parser susceptible to an exponential entity expansion attack.

--no-local-files
    Disable access to local files.

  NETWORK OPTIONS

--no-network
    Disable network access (prevents HTTP downloads).

--auth-user=USER, --auth-password=PASS
    Specify username and password for HTTP authentication.

--auth-server=HOST[:PORT]
    Send the --auth-user, --auth-password credentials only to the given server. The default is to send them to any server which challenges for authentication.

--auth-scheme=[http|https]
    Send the --auth-user, --auth-password credentials only for requests with the given scheme.

--auth-method=basic,digest,ntlm,negotiate
    Specify a list of HTTP authentication methods to enable (default: basic).

--auth=URL
    Specify a URL with credentials for HTTP authentication: [SCHEME:]//USER:PASS@HOST[:PORT]. Unlike the preceding options, --auth can be used multiple times. The username and password must be percent-encoded.

--no-auth-preemptive
    Do not send credentials to named servers until an authentication challenge is received. When multiple authentication methods are enabled, an initial request may be required to discover the methods supported by the remote site.

--http-proxy=PROXY
    Specify the HTTP proxy server.

--http-timeout=SEC
    Specify the HTTP timeout in seconds (default: 60).

--http-header=NAME:VALUE
    Specify a custom header to include in HTTP requests. If the header has the same name as a header that that would normally be sent, the custom header will take precedence. (Some headers are forbidden to be set.) This option can be used multiple times.

--cookie=COOKIE
    Specify a cookie that may be sent when making HTTP requests. The format is a Set-Cookie header field value, e.g. --cookie "name=value; domain=example.com". If you do not specify a domain for the cookie, it may not be sent. The exact behaviour depends on the underlying libcurl version. This option can be used multiple times.

--cookie-file=FILE
    Specify a file containing HTTP cookies. The cookies may be sent when making HTTP requests. The format of the file should be plain HTTP headers (Set-Cookie style) or the Netscape/Mozilla cookie file format.

--ssl-cacert=FILE
    Specify an SSL CA certificate file. This option is not supported on Windows.

--ssl-capath=PATH
    Specify an SSL CA certificate directory. This option is not supported on Windows.

--ssl-cert=FILE
    Specify an SSL client certificate file. Client authentication is not supported on Windows.

--ssl-cert-type=TYPE
    Specify the SSL client certificate file type (PEM, DER). The default is PEM.

--ssl-key=FILE
    Specify an SSL private key file.

--ssl-key-type=TYPE
    Specify the SSL private key file type (PEM, DER). The default is PEM.

--ssl-key-password=PASS
    Specify passphrase for the private key.

--ssl-version=VERSION
    Specify an SSL/TLS version to use (default, TLSv1, TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3). The default behaviour is to attempt to figure out the remote SSL protocol version.

--insecure
    Disable SSL verification (not recommended).

--ssl-no-revoke
    Disable certificate revocation checks. This option only has an effect on Windows.

--no-ssl-revoke-best-effort
    Do not ignore certificate revocation checks that fail due to missing or offline distribution points for the revocation check lists. The default behaviour is to ignore such failures. This option only has an effect on Windows; certificate revocations are not checked on other platforms.

--no-redirects
    Do not follow HTTP/HTTPS redirects. The default behaviour is to follow redirects.

--no-parallel-downloads
    Disable parallel downloads.

  JAVASCRIPT OPTIONS

-j, --javascript
    Enable JavaScript in HTML documents.

--script=FILE
    Run an external script prior to document scripts. This option can be used multiple times.

--max-passes=NUM
    Specify a limit on the number of times that the document may be laid out. By default, there is no limit. The first pass always occurs. The second and subsequent passes will occur if a JavaScript function registered with Prince.registerPostLayoutFunc modifies the DOM.

  CSS OPTIONS

-s, --style=FILE
    Apply an external style sheet. This option can be used multiple times.

--media=MEDIA
    Specify the media type (e.g. print, screen).

--page-size=SIZE
    Specify the page size (e.g. A4).

--page-margin=MARGIN
    Specify the page margin (e.g. 20mm). The syntax for MARGIN is as for the CSS `margin' property: e.g. three space-separated lengths give the top, side and bottom page margins respectively. (However, see the --mirror-margins option.)

--mirror-margins
    This option causes a four-term argument to --page-margin to be interpreted as TOP OUTSIDE BOTTOM INSIDE. Put another way, this option means that --page-margin specifies margins for right pages, while left pages have margins that are the mirror image of that.

    (The choice of the --page-margin argument applying to right rather than recto or left pages means that the more visible outside margin comes first, and is convenient for books where the outside margin is to be either equal to the top margin or between the sizes of the top and bottom margins.)

--no-author-style
    Ignore author style sheets.

--no-default-style
    Ignore default style sheets.

  PDF OUTPUT OPTIONS

-o, --output=FILE
    Specify the output PDF filename.

--pdf-profile=PROFILE
    Specify the PDF profile to use (PDF/A-1a, PDF/A-1b, PDF/A-2a, PDF/A-2b, PDF/A-3a, PDF/A-3b, PDF/UA-1, PDF/A-1a+PDF/UA-1, PDF/A-2a+PDF/UA-1, PDF/A-3a+PDF/UA-1, PDF/X-1a:2001, PDF/X-1a:2003, PDF/X-3:2002, PDF/X-3:2003, PDF/X-4, PDF/X-4p).

--pdf-output-intent=ICC
    Specify the PDF/A or PDF/X output intent ICC profile.

--pdf-script=FILE
    Include an AcroJS script to run when the PDF is opened. This option can be used multiple times.

--pdf-event-script=EVENT:FILE
    Include an AcroJS script to run on a specific event (will-close, will-save, did-save, will-print, did-print). This option can be used multiple times but each event type can only have one script.

--attach=FILE
    Attach a file to the PDF. This option can be used multiple times.

--attach-data=FILE
    Attach a file to the PDF with the AFRelationship key set to Data. This option can be used multiple times.

--attach-source=FILE
    Attach a file to the PDF with the AFRelationship key set to Source. This option can be used multiple times.

--attach-alternative=FILE
    Attach a file to the PDF with the AFRelationship key set to Alternative. This option can be used multiple times.

--attach-supplement=FILE
    Attach a file to the PDF with the AFRelationship key set to Supplement. This option can be used multiple times.

--attach-unspecified=FILE
    Attach a file to the PDF with the AFRelationship key set to Unspecified. This option can be used multiple times.

--tagged-pdf
    Produce tagged PDF.

--pdf-forms
    Enable generation of interactive form fields from HTML form control elements by default.

--no-artificial-fonts
    Disable synthesis of missing bold/italic fonts.

--no-embed-fonts
    Disable font embedding in PDF output.

--no-subset-fonts
    Disable font subsetting in PDF output.

--force-identity-encoding
    Use identity encoding for all fonts.

--no-rename-duplicate-fonts
    Disable renaming of fonts with duplicate names.

--no-compress
    Disable compression of PDF output.

--no-object-streams
    Disable use of PDF object streams.

--convert-colors
    Convert colors to output intent color space.

--fallback-cmyk-profile=ICC
    Set fallback ICC profile for uncalibrated CMYK. The output intent color space takes precedence if it is CMYK.

  PDF METADATA OPTIONS

--pdf-lang=LANG
    Specify the primary language as a RFC 3066-style language tag (e.g. en).

--pdf-xmp-metadata
    Include HTML metadata as XMP in the PDF.

--pdf-xmp=FILE
    Include additional XMP metadata from a file in the PDF.

--pdf-title=TITLE
    Set PDF document title.

--pdf-subject=SUBJECT
    Set PDF document subject.

--pdf-author=AUTHOR
    Set PDF document author.

--pdf-keywords=KEYWORDS
    Set PDF document keywords.

--pdf-creator=CREATOR
    Set PDF document creator.

  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-modify
    Disallow modification of PDF output. This includes document assembly unless used with --allow-assembly.

--disallow-copy
    Disallow copying from PDF output.

--disallow-annotate
    Disallow annotation of PDF output.

--allow-copy-for-accessibility
    Allow copying content for accessibility purposes even when copying is disallowed by --disallow-copy.

--allow-assembly
    Allow document assembly even when other modifications are disallowed by --disallow-modify.

  FAIL-SAFE OPTIONS

--fail-safe
    Set all of the following fail-safe options.

--fail-invalid-license
    Fail if the license is invalid or inapplicable.

--fail-dropped-content
    Fail if any content is dropped.

--fail-missing-resources
    Fail if any resources cannot be loaded.

--fail-missing-glyphs
    Fail if glyphs cannot be found for any characters.

--fail-incorrect-references
    Fail if a cross-reference cannot be resolved correctly (because it would lead to an infinite loop).

--fail-stripped-transparency
    Fail if any transparency is stripped.

--fail-pdf-profile-error
    Fail if there are problems complying with the specified PDF profile, e.g. due to incompatible options.

--fail-pdf-tag-error
    Fail if there are problems tagging the PDF document for accessibility.

  RASTER OUTPUT OPTIONS

--raster-output=TEMPLATE
    Enable raster output, and rasterise each selected page to an image file named according to the template. These field specifications are allowed within TEMPLATE:

    %d is replaced by the page number

    %0NUMd is replaced by the page number, padded with leading zeroes so that the field is at least NUM characters long

    %NUMd is replaced by the page number, padded with leading spaces so that the field is at least NUM characters long (NUM must begin with a non-zero digit)

    %% is replaced by a single percent sign.

--raster-format=auto|png|jpeg
    Set the output format for raster output, when raster output is enabled. The default value auto selects the output format based on the file name extension in the --raster-output template.

--raster-jpeg-quality=NUM
    Set quality when writing raster output to JPEG format. The value ranges from 0 to 100 (default: 92).

--raster-pages=all|first|NUM
    Set range of pages to rasterise (default: all).

--raster-dpi=DPI
    Set resolution of raster output.

--raster-background=white|transparent
    Set background color of raster output (default: white).

--raster-threads=NUM
    Set number of threads to use for producing raster output.

  UTILITY OPTIONS

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

--font-specimen FONT
    Generate a font specimen for a font. The generated PDF document includes sample text set in the font as well as information about the font. The --sample-text option allows the sample text to be configured.

    FONT is the path to a local font or the URL of a remote font. Font formats including OpenType, TrueType, WOFF, and WOFF2 are supported. For files containing multiple fonts, the font within the collection may be selected by appending a # and the one-based index of the font (e.g. #5).

--sample-text TEXT
    Sample text to use in a font specimen. If not supplied then a default phrase is used. If the font does not contain the glyphs to render the sample text then a random selection of glyphs is used.

--control
    Communicate via the control interface.

COPYRIGHT
Copyright © 2002-2026 YesLogic Pty. Ltd.

SEE ALSO
For more information, see https://www.princexml.com