Prince
  • Buy Prince
  • Samples
  • Documentation
  • Forum
  • Download
  • Installation Guide
  • User Guide
  • Reference Guide

Contents

  • 1. Getting Started
    • Installing Prince
      • Installing Prince on Windows
      • Installing Prince on MacOS X
      • Installing Prince on Linux
        • Debian and Ubuntu
        • Redhat and CentOS
        • OpenSUSE
        • FreeBSD, Solaris and Generic Linux
      • Installing a license file
    • Your First Document
      • The lab report
      • Processing the document
      • Styling the document
    • If Something Didn't Work
      • Missing fonts
      • Fontconfig
      • Image formats
      • Shared library trouble
      • PATH issues
  • 2. Formatting
    • CSS Box Model
    • Tables
      • Running table headers and footers
      • Numbering table rows
      • Automatic table layout
      • Fixed table layout
      • Separated table borders
      • Collapsing table borders
      • Cells that span columns
      • Cells that span rows
    • Lists
      • List marker position
      • List marker type
      • List marker style
    • Images
      • Images in XHTML
      • Images in DocBook
      • Images in arbitrary XML
    • Scalable Vector Graphics (SVG)
      • Viewbox and viewport
      • Rectangles
      • Circles
      • Ellipses
      • Lines
      • Polylines
      • Polygons
      • Paths
      • Text
      • Images
      • Links
      • Transformations
      • Style Properties
  • 3. Paged Media
    • Styling pages
      • Page size
      • Page style
      • Page headers and footers
      • Generated content in headers and footers
      • Footnotes
    • Some @page selectors
      • The :first, :Nth, :left and :right page selectors
      • Named pages
    • Controlling pagination
      • Page breaks
      • Widows and orphans
    • Advanced paged media examples
      • The :blank page selector
      • Page groups
      • Page breaks and decoration
      • Printing wide content sideways
  • 4. Prince Input
    • Applying Style Sheets
      • Importing Style Sheets
      • Conflicting Declarations
      • Priority Determination
    • XML Input
      • XML Input
        • Validation
        • xml:lang
        • xml:id
        • xml:base
      • XML Styling
      • XML Inclusions (XInclude)
        • Including XML files
        • Including text files
        • Fallback
    • Using JavaScript with Prince
      • Logging
      • Console access
      • Event handling
      • Document statistics
      • PDF properties
      • Unsupported DOM properties
  • 5. Prince Output
    • PDF Output Options
      • PDF Compression
      • Font Embedding
      • Creating PostScript output
    • PDF Bookmarks
      • Bookmark levels
      • Bookmark labels
      • Bookmark targets
    • PDF Metadata
    • PDF Profiles
  • 6. Server Integration
    • Using Prince from Java
    • Using Prince from .NET with C#
    • Using Prince from .NET with VB.NET
    • Using Prince from Python
    • Using Prince from Perl
    • Using Prince from PHP
    • Using Prince from ASP
    • Using Prince from ColdFusion
      • Using Java
      • Using ActiveX/COM
    • Using Prince from ActiveX / COM / Visual Basic
  • 7. Prince Tips and Tricks
    • Generated Content
      • Page headers and footers
      • List markers
      • Footnote markers
      • Before and After pseudo-elements
      • Counters and Numbering
        • Counter reset and increment
        • Nested counters
        • Counter styles
      • Cross-references
        • Using target-counter
        • Using target-content
      • Script Functions
        • Accessing the current date and time
        • User-defined counter styles
      • Using generated content in margin boxes
      • Copying text content from the document
      • Taking elements from the document
    • Imaging and color
      • Color (RGB, CMYK, spot colors)
        • RGB
        • RGBA
        • CMYK
        • Spot colors
  • 8. Fonts
    • Generic font families
    • Redefining the generic font families

Reference Guide

  • A1. Command-line Reference
    • Examples
    • Specifying input and output
    • Options
      • General Options
      • Logging Options
      • Input Options
      • Network Options
      • JavaScript Options
      • CSS Options
      • PDF Output Options
      • PDF Metadata Options
      • PDF Encryption Options
      • Utility Options
  • A2. CSS Selectors
    • Universal Selectors
    • Type Selectors
    • Descendant Selectors
    • Child Selectors
    • Direct Sibling Selectors
    • Indirect Sibling Selectors
    • Attribute Selectors
    • Class Selectors
    • ID Selectors
    • Link Selectors
    • Language Selectors
    • Contains Selectors
    • Root Selectors
    • Empty Selectors
    • Negated Selectors
    • Child Selectors
    • Typed Child Selectors
    • Nth Child Selectors
    • Nth Last Child Selectors
    • Nth of Type Selectors
    • Nth Last of Type Selectors
    • Pseudo-element Selectors
  • A3. CSS Properties
    • background
    • background-attachment
    • background-clip
    • background-color
    • background-image
    • background-origin
    • background-position
    • background-repeat
    • background-size
    • border
    • border-bottom
    • border-bottom-color
    • border-bottom-left-radius
    • border-bottom-right-radius
    • border-bottom-style
    • border-bottom-width
    • border-clip
    • border-collapse
    • border-color
    • border-left
    • border-left-color
    • border-left-style
    • border-left-width
    • border-radius
    • border-right
    • border-right-color
    • border-right-style
    • border-right-width
    • border-spacing
    • border-style
    • border-top
    • border-top-color
    • border-top-left-radius
    • border-top-right-radius
    • border-top-style
    • border-top-width
    • border-width
    • bottom
    • box-decoration-break
    • box-sizing
    • caption-side
    • clear
    • clip
    • clip-path
    • clip-rule
    • color
    • column-break-after
    • column-break-before
    • column-count
    • column-fill
    • column-gap
    • column-rule
    • column-rule-color
    • column-rule-style
    • column-rule-width
    • column-span
    • column-width
    • columns
    • content
    • counter-increment
    • counter-reset
    • direction
    • display
    • empty-cells
    • float
    • font
    • font-family
    • font-size
    • font-stretch
    • font-style
    • font-variant
    • font-weight
    • footnote-style-position
    • height
    • hyphens
    • left
    • letter-spacing
    • line-height
    • line-stacking-strategy
    • list-style
    • list-style-image
    • list-style-position
    • list-style-type
    • margin
    • margin-bottom
    • margin-inside
    • margin-left
    • margin-outside
    • margin-right
    • margin-top
    • marks
    • max-height
    • max-width
    • min-height
    • min-width
    • opacity
    • orphans
    • overflow
    • overflow-wrap
    • padding
    • padding-bottom
    • padding-left
    • padding-right
    • padding-top
    • page
    • page-break-after
    • page-break-before
    • page-break-inside
    • position
    • prince-background-image-resolution
    • prince-bleed
    • prince-bookmark-label
    • prince-bookmark-level
    • prince-bookmark-state
    • prince-bookmark-target
    • prince-caption-page
    • prince-flow
    • prince-footnote-policy
    • prince-forced-breaks
    • prince-hyphenate-after
    • prince-hyphenate-before
    • prince-hyphenate-lines
    • prince-hyphenate-patterns
    • prince-image-magic
    • prince-image-resolution
    • prince-linebreak-magic
    • prince-link
    • prince-mark-length
    • prince-mark-offset
    • prince-page-group
    • prince-pdf-destination
    • prince-pdf-link-type
    • prince-pdf-open-action
    • prince-pdf-output-intent
    • prince-pdf-page-label
    • prince-pdf-page-layout
    • prince-pdf-page-mode
    • prince-pdf-paper-tray
    • prince-pdf-print-scaling
    • prince-pdf-profile
    • prince-pdf-script
    • prince-rotate-body
    • prince-shrink-to-fit
    • prince-text-justify
    • prince-text-replace
    • prince-trim
    • prince-wrap-inside
    • right
    • size
    • string-set
    • table-baseline
    • table-column-span
    • table-layout
    • table-row-span
    • text-align
    • text-align-last
    • text-decoration
    • text-indent
    • text-line-through
    • text-line-through-color
    • text-line-through-style
    • text-overflow
    • text-overline
    • text-overline-color
    • text-overline-style
    • text-transform
    • text-underline
    • text-underline-color
    • text-underline-style
    • top
    • transform
    • transform-origin
    • unicode-bidi
    • vertical-align
    • visibility
    • white-space
    • widows
    • width
    • word-break
    • word-spacing
    • writing-mode
    • z-index
  • A4. Appendix
    • Unsupported features in CSS 2.1
    • Page Size Keywords
    • Character Entities
      • Accented Letters
      • Symbols
      • Quotes
      • Accents
      • Miscellaneous
  • A5. Acknowledgements

Command-line Reference

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

prince OPTIONS FILE -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.
--credits
Display credits and acknowledgements.

Logging Options

-v, --verbose
Log informative messages.
--debug
Log debug messages.
--log=FILE
Append log messages to a file.

Input Options

-i FORMAT, --input=FORMAT
Set input format [auto | xml | html | html5].
-l, --input-list=FILE
Read input file list from specified file.
--baseurl=URL
Specify the base URL of the input document.
--remap=URL=DIR
Rather than retrieving documents beginning with URL get them from the local directory DIR. This option can be used multiple times to specify more than one remapping. It cannot be used with --fileroot
--fileroot=DIR
Specify the root directory for absolute filenames.
--no-xinclude
Disable XInclude processing.

Network Options

--no-network
Disable network access (prevents HTTP downloads).
--auth-user=USER
Specify the username for HTTP authentication.
--auth-password=PASS
Specify the password for HTTP authentication.
--auth-server=HOST[:PORT]
Send username and password credential to the specified server only. (The default is to send them to any server which challenges for authentication).
--auth-scheme=SCHEME
Send username and password credentials only for requests with the given scheme, either http or https
--auth-method=METHOD
Specify a comma separated list of HTTP authentication methods to enable. Valid entries are: basic, digest, ntlm and negotiate. The default is basic.
--auth=URL
Specify a URL with credentials for HTTP authentication: [SCHEME:]//USER:PASS@HOST[:PORT]. Unlike the preceding options, --auth may 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.
--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).
--no-parallel-downloads
Disable downloading multiple HTTP resources at once.

JavaScript Options

--javascript
Enable JavaScript in HTML documents.
--script=FILE
Run an external script.

CSS Options

-s FILE, --style=FILE
Apply a CSS file.
--media=MEDIA
Specify the media type (eg. print, screen).
--page-size=SIZE
Specify the page size (eg. A4).
--page-margin=MARGIN
Specify the page margin (eg. 20mm).
--no-author-style
Ignore author style sheets.
--no-default-style
Ignore default style sheets.

PDF Output Options

-o FILE.PDF, --output=FILE.PDF
Specify the output PDF file.
--pdf-profile=PROFILE
Specify the PDF profile (PDF Profiles) to use.
--pdf-output-intent=ICC
Specify the ICC profile to use.
--attach=FILE
Attach a file to the PDF.
--no-artificial-fonts
Disable synthesis of missing bold/italic fonts.
--no-embed-fonts
Disable font embelistiteming in PDF output.
--no-subset-fonts
Disable font subsetting in PDF output.
--no-compress
Disable compression of PDF output.

PDF Metadata Options

--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 either 40 or 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.
Copyright © 2002 – 2019 YesLogic Pty. Ltd.
  • About Us
  • Privacy Policy
  • Contact Us