Prince 5 feature highlights
- Prints any XML document to PDF
- Strong support for Cascading Style Sheets
- Flexible running page headers/footers
- Advanced pagination and duplex printing
- Automatic numbering and generated content
- Multi-column layout and floating blocks
- Support for XHTML and SVG
- Support for JPEG, PNG, TIFF and GIF images
- XML namespaces, DTDs and external entities
- Command-line as well as graphical user interface
Download Prince 5.0-beta4
| Platform | Download File | Size | |
|---|---|---|---|
![]() |
Windows | prince-5.0-beta4-setup.exe | 3.0MB |
![]() |
MacOS X | prince-5.0-beta4-macosx.tar.gz | 1.8MB |
![]() |
Debian GNU/Linux package | prince_5.0-1_i386.deb | 1.3MB |
| Debian GNU/Linux | prince-5.0-beta4-debian.tar.gz | 1.5MB | |
| GNU/Linux static | prince-5.0-beta4-linux.tar.gz | 2.1MB | |
Prince5 documentation
CSS Properties
Prince5 supports a subset of the CSS2 properties for Fonts, Text, the Box Model, Tables, Lists and Generated Content. Prince also supports many of the CSS3 Paged Media properties. Below are examples of all the properties; for their precise definitions please refer to the CSS specifications.
| Property | Values |
|---|---|
| background | background-color || background-image || background-position || background-repeat |
| background-color | color |
| background-image | none | url(filename) |
| background-position | left || right || top || bottom || center || length || percent |
| background-repeat | repeat | repeat-x | repeat-y | no-repeat |
| bookmark-label* | none | content |
| bookmark-level* | none | integer |
| bookmark-target* | self | url(target-url) | attr(target-attr) |
| border | color || border-style || border-width |
| border-bottom | color || border-style || border-width |
| border-bottom-color | color |
| border-bottom-style | none | solid | dashed | dotted | hidden |
| border-bottom-width | thin | medium | thick | length |
| border-collapse | separate | collapse |
| border-color | color {1..4} |
| border-left | color || border-style || border-width |
| border-left-color | color |
| border-left-style | none | solid | dashed | dotted | hidden |
| border-left-width | thin | medium | thick | length |
| border-right | color || border-style || border-width |
| border-right-color | color |
| border-right-style | none | solid | dashed | dotted | hidden |
| border-right-width | thin | medium | thick | length |
| border-spacing | length {1..2} |
| border-style | border-style {1..4} |
| border-top | color || border-style || border-width |
| border-top-color | color |
| border-top-style | none | solid | dashed | dotted | hidden |
| border-top-width | thin | medium | thick | length |
| border-width | border-width {1..4} |
| bottom | auto | length | percent |
| caption-side | top | bottom |
| clear | none | left | right | inside | outside | both |
| clip | auto | rect(offset, offset, offset, offset) |
| color | color |
| column-count | number |
| column-gap | length |
| column-rule | column-rule-color || column-rule-style || column-rule-width |
| column-rule-color | color |
| column-rule-style | none | solid | dashed | dotted |
| column-rule-width | length |
| column-span | number | attr(colspan) |
| content | normal | flow(name, page-policy?) | [ "string" | url(filename) | counter(name, counter-style?, page-policy?) | counters(name, "separator", counter-style?, page-policy?) | target-counter(url, counter, counter-style?) | target-content(url) | string(ident, page-policy?) | content() ]+ |
| counter-increment | none | [ name number? ]+ |
| counter-reset | none | [ name number? ]+ |
| display | inline | block | none | list-item | run-in | table | table-header-group | table-footer-group | table-row-group | table-row | table-cell | table-caption | table-column | table-column-group | inline-block | inline-table | prince-footnote |
| empty-cells | show | hide |
| float | none | left | right | inside | outside | top | bottom | top-next | bottom-next |
| flow* | normal | static(name) |
| font | font-style? font-weight? font-size [ / line-height ]? font-family |
| font-family | [ serif | sans-serif | monospace | name | "name" ]+ |
| font-size | length | smaller | larger | xx-small | x-small | small | medium | large | x-large | xx-large |
| font-style | normal | italic |
| font-weight | normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 |
| footnote-style-position | outside | inside |
| height | auto | length | percent |
| image-resolution* | dpi | normal | auto [ , normal | dpi ]? |
| left | auto | length | percent |
| letter-spacing | normal | length |
| line-stacking-strategy | inline-line-height | block-line-height | max-height | grid-height |
| line-height | normal | none | number | length |
| link* | none | url(target-url) | attr(target-attr) |
| list-style | list-style-position || list-style-type |
| list-style-position | outside | inside |
| list-style-type | disc | hyphen | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-alpha | upper-alpha | lower-hexadecimal | upper-hexadecimal | binary | octal | asterisks |
| margin | [ auto | length | percent ] {1..4} |
| margin-bottom | auto | length | percent |
| margin-inside | auto | length | percent |
| margin-left | auto | length | percent |
| margin-outside | auto | length | percent |
| margin-right | auto | length | percent |
| margin-top | auto | length | percent |
| max-height | none | length | percent |
| max-width | none | length | percent |
| min-height | length | percent |
| min-width | length | percent |
| orphans | integer |
| overflow | visible | hidden |
| padding | [ length | percent ] {1..4} |
| padding-bottom | length | percent |
| padding-left | length | percent |
| padding-right | length | percent |
| padding-top | length | percent |
| page | auto | name |
| page-break-after | auto | always | avoid |
| page-break-before | auto | always | avoid | left | right |
| page-break-inside | auto | avoid |
| position | static | relative | absolute | fixed |
| prince-bookmark-label* | none | content |
| prince-bookmark-level* | none | integer |
| prince-bookmark-target* | self | url(target-url) | attr(target-attr) |
| prince-flow* | normal | static(name) |
| prince-image-resolution* | dpi | normal | auto [ , normal | dpi ]? |
| prince-link* | none | url(target-url) | attr(target-attr) |
| right | auto | length | percent |
| row-span | number | attr(rowspan) |
| string-set | none | [ ident content ]+ |
| table-layout | auto | fixed |
| text-align | left | right | inside | outside | center | justify |
| text-decoration | none | underline || overline || line-through |
| text-height | auto | font-size | text-size | max-size |
| text-indent | length hanging? |
| text-line-through | color || text-line-through-style |
| color | |
| text-line-through-style | none | solid | dashed | dotted |
| text-overline | color || text-overline-style |
| text-overline-color | color |
| text-overline-style | none | solid | dashed | dotted |
| text-transform | none | lowercase | uppercase |
| text-underline | color || text-underline-style |
| text-underline-color | color |
| text-underline-style | none | solid | dashed | dotted |
| top | auto | length | percent |
| vertical-align | baseline | sub | super | top | text-top | middle | bottom | text-bottom | length | percent |
| visibility | visible | hidden |
| white-space | normal | pre | pre-wrap | pre-line | nowrap |
| widows | integer |
| width | auto | length | percent |
| word-spacing | normal | length |
* properties marked with an asterisk are Prince extensions.
Command-line Interface
prince [OPTIONS] INPUT [OUTPUT]
The command line must contain the name of the input file to process.
The output file name can be specified on the command line after the input file name.
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:
| Option | Shorthand | Comment |
|---|---|---|
| --style FILE.CSS | -s | Apply a Cascading Style Sheet |
| --input FORMAT | -i | Set input format [xml | xhtml | docbook | auto] |
| --help | -h | Display usage and options |
| --version | Display version information | |
| --verbose | -v | Log informative messages |
| --no-embed-fonts | Disable font embedding in PDF output | |
| --no-compress | Disable compression of PDF output | |
| --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 |
Examples
- prince FILE.XML
- Prints FILE.XML to a PDF file (FILE.PDF).
- prince INPUT.XML OUTPUT.PDF
- Prints INPUT.XML to OUTPUT.PDF.
- prince -s STYLE1.CSS -s STYLE2.CSS INPUT.XML OUTPUT.PDF
- Prints INPUT.XML to OUTPUT.PDF, applying two user style sheets.
Frequently Answered Questions (FAQ)
(Under construction)
- How can I remove jaggies in the generated PDF document?
- The jaggies are not in PDF document itself, but are artefacts of the previewer. To remove them, turn on all "smooth" switches. In Adobe Reader, you can set "smooth text", "smooth line art" and "smooth images" in Edit->Preferences.
- How can I replace "ASCII quotes" with proper “curly quotes” in my documents?
- Prince can't do this. Try running your document through this script.
- How can I generate a table of contents (TOC)?
- Prince can't do this. Try using Bert Bos' HTML-XML-utils.



