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

Command-line Reference

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:

"C:\Program Files (x86)\Prince\engine\bin\prince.exe" OPTIONS FILES [-o PDF]

Examples

prince file.xml
Convert file.xml to file.pdf.
prince doc.html -o out.pdf
Convert doc.html to out.pdf.
prince http://example.com -o out.pdf
Convert the http://example.com webpage to out.pdf. Note that it is necessary to specify the output file when the input is a HTTP or HTTPS URL.
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.
prince doc.html --raster-output=doc_%d.png
Process doc.html and rasterize the output to the series of files doc_1.png, doc_2.png, doc_3.png etc.

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.

It is necessary to specify the output file when the input is a HTTP or HTTPS URL.

Any of the --long command-line options can either be passed as a single command-line argument with an equals sign (=), or as two command-line arguments with space:

  --output out.pdf
  --output=out.pdf

If the value of a command-line option contains a space or other command characters, the value has to be written between quotation marks.

If rasterization is used, the -o option is optional. If not specified, a PDF output will not be generated.

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 acknowledgments.

Logging Options

-v, --verbose
Log informative messages.
--debug
Log debug messages.
--log=FILE
Append log messages to a file.
--no-warn-css-unknown
Do not warn about unknown CSS features.
--no-warn-css-unsupported
Do not warn about unsupported CSS features.
--no-warn-css
Do not warn about CSS problems - this option implies the above two options.

Input Options

-i FORMAT, --input=FORMAT
Set input format [auto | xml | html].
-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.

Note that Prince does not know which file to use when the path maps to a directory (in other words, an index file). If http://www.example.com/ is requested, and mapped to example-com it does not know whether to open example-com/index.html, example-com/index.php or any other file as this is site dependent. In this case Prince will report an error for that resource.

--fileroot=DIR
Specify the root directory for absolute filenames (deprecated).
--xinclude
Enable XInclude and XML external entities (XXE). Note that XInclude only applies to XML files. To apply it to HTML files, the input format needs to be specified with the --input command-line option.
--xxe, --xml-external-entities
Enable XML external entities (XXE).
--no-local-files
Disable access to local files.

Network Options

--no-network
Disable network access (prevents HTTP downloads).
--no-redirects
Disable all HTTP and HTTPS redirects.
--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 credentials 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.
--cookie=COOKIE
Set a value for the Set-Cookie HTTP header value. --cookie may be used multiple times.
--cookiejar=FILE
Specify a file containing HTTP cookies.
--ssl-cacert=FILE
Specify an SSL certificate file.
--ssl-capath=PATH
Specify an SSL certificate directory.
--ssl-cert=FILE
Specify an SSL client certificate file. On MacOS, specify a PKCS#12 file containing a client certificate and private key. Client authentication is not supported on Windows.
--ssl-cert-type=TYPE
Specify the SSL client certificate file type (PEM, DER). The default is PEM. This option is not supported on MacOS or Windows.
--ssl-key=FILE
Specify an SSL private key file. This option is not supported on MacOS or Windows.
--ssl-key-type=TYPE
Specify the SSL private key file type (PEM, DER). The default is PEM. This option is not supported on MacOS or Windows.
--ssl-key-password=PASS
Specify passphrase for the private key.
--ssl-version=VERSION
Set the minimum version of SSL to allow. May be one of: default (let libcurl choose), tlsv1, tlsv1.0, tlsv1.1 or tlsv1.2.
--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 an external style sheet.
--media=MEDIA
Specify the media type (eg. print, screen).
--page-size=SIZE
Specify the page size (eg. A4, "155mm 190mm", etc). The syntax is the same as the size property in @page rules, which can take two values for horizontal and vertical dimensions. On the command-line it needs to be written between quotes as a single argument. See also Page size and Page Size Keywords.
--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-lang=LANG
Specify the PDF document's language.
--pdf-profile=PROFILE
Specify the PDF profile (see PDF Versions and 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 embedding in PDF output.
--no-subset-fonts
Disable font subsetting in PDF output.
--no-system-fonts
Disable system fonts in PDF output. Only fonts defined with @font-face rules in CSS will be available.
--force-identity-encoding
Ensure that all fonts are encoded in the PDF using their identity encoding (directly mapping to glyph indices), even if they could have used MacRoman or some other encoding.
--no-compress
Disable compression of PDF output.
--no-object-streams
Disable PDF object streams.
--convert-colors
Convert colors to output intent color space.
--fallback-cmyk-profile=ICC
Set fallback ICC profile for uncalibrated CMYK.
--tagged-pdf
Enable tagged PDF.
--css-dpi
Changes the DPI of the "px" units in CSS, which defaults to 96dpi. It can be useful if you have a layout designed in pixels and you need to scale it down for print.

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-xmp=XMP
Include additional XMP metadata in the PDF. The argument is an XMP file, from which the data is taken.

PDF Encryption Options

--encrypt
Encrypt PDF output.
--key-bits=NUM
Set encryption key size to 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.

Raster Output Options

Rasterization is enabled with the --raster-output option below. When this is used the PDF output option (-o) is optional.

--raster-output=TEMPLATE

Enable raster output. The output files will be named based on the template. Prince will replace every '%[WIDTH]d' with the current page number. The optional WIDTH value gives the number of characters the page number should take within the file name. Smaller page numbers will be padded to the left with either spaces, or if the width begins with a zero, with zeros.

For example --raster-output=page_%02d.png will cause Prince to generate page_01.png, page_02.png, …, page_10.png, page_11.png etc.

Prince also accepts `-' meaning the standard output stream.

--raster-format=FORMAT
Set the format for the raster output. Valid formats are: auto (guess based on file extension, the default), png or jpeg. If Prince does not recognize the file extension, or --raster-output is '-', then it is necessary to provide this option.
--raster-pages=PAGE
Set the range of pages to be rasterize. Valid ranges are all (the default), first and NUM (a single page).
--raster-dpi=DPI
Set the resolution of raster output (The default is 96 dots per inch).
--raster-threads=NUM
Set the number of threads to use for multi-threaded rasterization. By default Prince chooses the number of threads based on the number of cores and hyperthreads your system provides.
--raster-background=BACKGROUND
Set the background - allowed values are transparent or white. It can be used when rasterizing to an image format that supports transparency (PNG, not JPG) and have a transparent background, so it can be composited with something else later.

Utility Options

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

Advanced Control and Log Options

--capture DIR
--replay DIR

The capture/replay system saves a copy of all the information in a job to a specified directory, conveniently allowing it to be replayed later for debugging purposes. See also The capture/replay system.

--control

The Prince Control Protocol is a synchronous bidirectional protocol that consists of a sequence of "chunks" sent via the standard input and output streams. For more details, please check the detailed documentation in the separate Prince Control Protocol chapter.

--structured-log=LEVEL

The Structured Log option is a formatting option for Prince's output to stderr. For more details, please check the detailed documentation in the separate Structured Log chapter.

CSS References

In this section you find the documentation for the supported CSS features.

Supported CSS Specifications

Prince supports, fully or partially, the following CSS specifications:

CSS Level 2
CSS 2.1 Prince supports the specification, with few exceptions: Prince does not support the quotes property or the open-quote and close-quote values. Prince does not support properties that apply only to interactive media. Note that this includes outline and its outline-* subproperties. For similar reasons, Prince does not support visibility: collapse. Prince does not support the armenian or georgian list styles. Prince treats 1ex equivalently to 0.5em, which might not be correct for some fonts.
CSS Level 3
CSS Backgrounds and Borders Module Level 3 Prince does not support box-shadow and the border-image properties.
CSS Fragmentation Module Level 3 Prince does not support break-{before,after,inside}. However, Prince supports also the Prince-specific properties column-break-{before,after}. The initial value of widows and orphans has been changed from 2 to 1.
CSS Color Module Level 3 Prince supports opacity. It supports some of the extensions of the color property. rgba() is supported in builds after Prince 11.
CSS Generated Content Module Level 3 Prince does not recognize the quotes property and the quote-related content types.
CSS Fonts Module Level 3 Beyond the definitions in CSS 2.1, only font-stretch is recognized. However, Prince provides a different interface to the functionality of the font-variant-* and font-feature-settings properties.
CSS Generated Content for Paged Media Module Prince recognizes footnote-display and string-set as well as the mechanism for running elements. It does not recognize the running or footnote-policy properties, but Prince provides a different interface to the functionality of footnotes.
CSS Image Values and Replaced Content Module Level 3 Prince recognizes image-resolution, but takes a different syntax.
CSS Images Module Level 3 - Editor's Draft Prince supports the mandatory values of image-orientation.
CSS Multi-column Layout Module Prince largely supports this module.
CSS Overflow Module Level 3 Prince only recognizes the overflow property from CSS 2.1. However, it supports its behaviour as described in the Level 3 module.
CSS Paged Media Module Level 3 Prince largely supports this module.
CSS Text Module Level 3 Prince does not recognize line-break, text-align-all and hanging-punctuation, and it does not support the value break-word of the property word-break.
CSS Transforms Module Level 1 Prince recognizes transform and transform-origin, but does not recognize transform-box. Prince does not allow perspective transforms.
CSS Basic User Interface Module Level 3 (CSS3 UI) Prince recognizes box-sizing and text-overflow.
CSS Writing Modes Level 3 Prince partially implements writing-mode.
CSS Namespaces Module Level 3 Prince supports namespaces in CSS.
CSS Conditional Rules Module Level 3 Prince supports the @media and @supports at-rules.
Filter Effects Module Level 1 Prince supports the filter property.
CSS Level 4
CSS Flexible Box Layout Module Level 1 Prince supports this module as of Prince 12, with the exception of page breaking/fragmentation, break-before/-after, visibility:collapse and vertical writing.
Selectors Level 4 Prince largely supports this module.
Media Queries Level 4 Prince supports this module as of Prince 11.1.
CSS Cascading and Inheritance Level 4 Prince supports the new supports() condition for the @import rule.
CSS Backgrounds and Borders Module Level 4 Prince supports the border-clip property.
Living Standards
CSS Books Prince supports target counters, footnote floats, bookmarks labels, levels and states, the flow property and the string-set property.
CSS Figures Prince largely supports the float extensions of the spec.
SVG
SVG 1.1 Prince does not support alignment-baseline, color-interpolation, color-profile, enable-background, glyph-orientation-horizontal, kerning, mask, pointer-events (barely applicable to Prince), font-size-adjust, glyph-orientation-vertical.

Length Units

Prince supports the following length units:

Absolute Length Units

The absolute length units correspond to exact distances in the PDF file.

Absolute length units
cm centimeters
mm millimeters
q quarter-millimeters
in inches
pc picas
pt points

Font Length Units

The font length units are relative to the font-size property.

Font length units
em font size of the element
rem font size of the root element
ex x-height of the element's font

Pixel Unit

The pixel unit is relative to the de-facto standard of 96dpi (or rather, 96 pixel per inch) for compatibility with browsers.

Pixel unit
px pixel

CSS Properties

Below are all of the CSS properties supported by Prince. For their precise definitions please refer to the CSS specifications.

* properties marked with an asterisk and a darker background color shade are Prince extensions, while the extension values of a standard property are highlighted with a light grey background.

For the values, the grammar follows the CSS Values and Units Module Level 3 specification. A short explanation of the signs:

  • A bar (|) separates two or more alternatives: exactly one of them must occur.
  • A double bar (||) separates two or more options: one or more of them must occur, in any order.
  • A double ampersand (&&) separates two or more components, all of which must occur, in any order.
  • Square brackets ([ ]) are only used for grouping.
  • A plus (+) indicates that the preceding item occurs one or more times.
  • A question mark (?) indicates that the preceding item is optional (occurs zero or one times).
  • A hash mark (#) indicates that the preceding item occurs one or more times, separated by comma tokens.
  • A pair of numbers in curly braces, separated by two dots ({A..B}) indicates that the preceding item occurs at least A and at most B times.

Toggle (open/close) all properties

align-content
Syntax
align-content: flex-start | flex-end | center | space-between | space-around | stretch
Initial value stretch
Applies to multi-line flex containers
Inherited no
Specification
  • CSS Flexible Box Layout Module Level 1
align-items
Syntax
align-items: flex-start | flex-end | center | baseline | stretch
Initial value stretch
Applies to flex containers
Inherited no
Specification
  • CSS Flexible Box Layout Module Level 1
align-self
Syntax
align-self: auto | flex-start | flex-end | center | space-between | space-around
Initial value auto
Applies to flex items
Inherited no
Specification
  • CSS Flexible Box Layout Module Level 1
alternate-color*
Syntax
alternate-color: color
Initial value
Applies to all elements
Inherited no
Examples
@prince-color  TestColor { alternate-color: cmyk(1, 0, 0, 0) }

	color: prince-color(TestColor)
Comments

This property takes an RGB or CMYK color in any of the valid notations for RGB and CMYK colors, that will be used to display the color being defined, when the named color is not available. Please note that it cannot be RGBA or CMYKA.

A color value must be specified for the rule to be valid.

See Also
  • Spot colors
background
Syntax
background:
   [ background-image      || background-position [ / background-size ]?      || background-repeat      || background-attachment      || background-origin background-clip?      || background-color ]#
Initial value transparent
Applies to all elements
Inherited no
Comments

The background property is a shorthand for setting the following CSS properties:

  • background-image
  • background-position
  • background-size
  • background-repeat
  • background-attachment
  • background-origin
  • background-clip
  • background-color
Specification
  • CSS Backgrounds and Borders Module Level 3
background-attachment
Syntax
background-attachment: scroll | fixed
Initial value scroll
Applies to all elements
Inherited no
Comments

The background-attachment property determines the origin of the coordinate system for background images. The default value of scroll will position background images based on an origin at the top-left corner of the padding area of the current element, while a value of fixed places the origin at the top-left corner of the page box.

The background-attachment property only changes the origin of the coordinate system used to position the image; the background image will still only be shown within the padding area of the current element.

Specification
  • CSS Backgrounds and Borders Module Level 3
background-color
Syntax
background-color: color
Initial value transparent
Applies to all elements
Inherited no
See Also
  • Color
Specification
  • CSS Backgrounds and Borders Module Level 3
background-clip
Syntax
background-clip: content-box | padding-box | border-box
Initial value border-box
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
background-image
Syntax
background-image: none | url( filename ) | linear-gradient( ... ) | radial-gradient( ... ) | repeating-linear-gradient( ... ) | repeating-radial-gradient( ... )
Initial value none
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
background-image-resolution*
Syntax
background-image-resolution: dpi | normal | auto [ , normal | dpi ]?
Initial value normal
Applies to background image elements
Inherited yes
Comments

This property determines the resolution of a background image. The value normal means 96dpi, or else the current CSS DPI setting. A custom DPI value can also be specified. The value auto means to check the original resolution of the image. One can specify a second value, as for example auto, normal or auto, 300dpi in order to check the original resolution of the image first, and to fall back on the second value if the image doesn't contain resolution information.

The property prince-background-image-resolution can be used as an alias.

See Also
  • Image Size
background-origin
Syntax
background-origin: content-box | padding-box | border-box
Initial value padding-box
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
background-position
Syntax
background-position:
   left | center | right | top | bottom | length | percent    | [ left | center | right | length | percent ]       [ top | center | bottom | length | percent ]    | [ [ center | [ left | right ] [ length percent ]? ]        && [ center | [ left | right ] [ length percent ]? ] ]
Initial value top left
Applies to all elements
Inherited no
Comments

The background-position property determines the position of the background image relative to the top-left corner of the padding area of the element in which it appears.

The background-attachment property can be used to change the origin relative to which the background image is positioned.

Specification
  • CSS Backgrounds and Borders Module Level 3
background-repeat
Syntax
background-repeat: [ repeat-x | repeat-y | [ repeat | space | round | no-repeat ] {1..2} ]#
Initial value repeat
Applies to all elements
Inherited no
Comments

The background-repeat property determines whether the background image is repeated to cover the padding area of the current element with a rectangular tiling, or only repeated horizontally or vertically, or only drawn once and not repeated at all.

Specification
  • CSS Backgrounds and Borders Module Level 3
background-size
Syntax
background-size: [ contain | cover | [ auto | length | percent ] {1..2} ]#
Initial value auto auto
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
baseline-shift
Syntax
baseline-shift: baseline | sub | super | percent | length
Initial value baseline
Applies to inline elements
Inherited no
Comments

The baseline-shift property only applies to SVG text elements.

Specification
  • SVG 1.1
bleed*
Syntax
bleed: auto | [ length ] {1..4}
Initial value auto
Applies to @page at-rule
Inherited
Examples
@page { prince-bleed: 10mm }
Comments

This CSS at-rule descriptor can be used to specify the size of the bleed area of the page when crop marks are enabled.

The property prince-bleed can be used as an alias.

See Also
  • Page style
  • prince-trim
bookmark-label*
Syntax
bookmark-label: none | content
Initial value content()
Applies to all elements
Inherited no
Comments

This property is used to determine the text content of the PDF bookmark generated by the current element.

Several ways of creating content are here defined by means of functions - the detailed explanation can be found in the Generated Content Functions section.

Even though the initial value for this property is content(), no PDF bookmark will be generated by default as the initial value for the prince-bookmark-level property is none.

See the documentation for PDF Bookmarks for more details.

The property prince-bookmark-label can be used as an alias.

See Also
  • Generated Content Functions
  • Bookmark labels
  • content
Specification
  • CSS Books
bookmark-level*
Syntax
bookmark-level: none | integer
Initial value none
Applies to all elements
Inherited no
Comments

This property is used to determine the numeric level in the bookmark hierarchy of the PDF bookmark generated by the current element. See the documentation for PDF Bookmarks for more details.

The property prince-bookmark-level can be used as an alias.

See Also
  • Bookmark levels
Specification
  • CSS Books
bookmark-state*
Syntax
bookmark-state: open | closed
Initial value open
Applies to all elements
Inherited no
Comments

This property is used to determine whether the bookmark tree item is open or closed when the PDF is first viewed. In this way you can close each chapter and hide the subsections for documents that are very long, or you can choose to have a deep bookmark tree.

The property prince-bookmark-state can be used as an alias.

See Also
  • Bookmark levels
Specification
  • CSS Books
bookmark-target*
Syntax
bookmark-target: self | url( target-url ) | attr( target-attr )
Initial value self
Applies to all elements
Inherited no
Comments

This property is used to determine the link target for the PDF bookmark generated by the current element. See the documentation for PDF Bookmarks for more details.

The property prince-bookmark-target can be used as an alias.

See Also
  • Bookmark targets
border
Syntax
border: color || border-style || border-width
Initial value none
Applies to all elements
Inherited no
Comments

The border property is a shorthand for setting the following CSS properties:

  • border-bottom-color
  • border-bottom-style
  • border-bottom-width
  • border-left-color
  • border-left-style
  • border-left-width
  • border-right-color
  • border-right-style
  • border-right-width
  • border-top-color
  • border-top-style
  • border-top-width
Specification
  • CSS Backgrounds and Borders Module Level 3
border-bottom
Syntax
border-bottom: color || border-style || border-width
Initial value none
Applies to all elements
Inherited no
Comments

The border-bottom property is a shorthand for setting the following CSS properties:

  • border-bottom-color
  • border-bottom-style
  • border-bottom-width
Specification
  • CSS Backgrounds and Borders Module Level 3
border-bottom-color
Syntax
border-bottom-color: color
Initial value CurrentColor
Applies to all elements
Inherited no
See Also
  • Color
Specification
  • CSS Backgrounds and Borders Module Level 3
border-bottom-style
Syntax
border-bottom-style: none | hidden | solid | dashed | dotted | double | groove | ridge | inset | outset
Initial value none
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
border-bottom-width
Syntax
border-bottom-width: thin | medium | thick | length
Initial value medium
Applies to all elements
Inherited no
Comments

Even though the initial value for this property is medium, no bottom border will be shown by default as the initial value for border-bottom-style is none.

Specification
  • CSS Backgrounds and Borders Module Level 3
border-clip
Syntax
border-clip: normal | length | percent
Initial value normal
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 4
border-collapse
Syntax
border-collapse: separate | collapse
Initial value separate
Applies to all elements
Inherited yes
Comments

This property determines whether tables use separate table and cell borders or collapse the table and cell borders together. See the Tables documentation for more details.

Specification
  • CSS 2.1
border-color
Syntax
border-color: color {1..4}
Initial value CurrentColor
Applies to all elements
Inherited no
Comments

The border-color property is a shorthand for setting the following CSS properties:

  • border-bottom-color
  • border-left-color
  • border-right-color
  • border-top-color
See Also
  • Color
Specification
  • CSS Backgrounds and Borders Module Level 3
border-left
Syntax
border-left: color || border-style || border-width
Initial value none
Applies to all elements
Inherited no
Comments

The border-left property is a shorthand for setting the following CSS properties:

  • border-left-color
  • border-left-style
  • border-left-width
Specification
  • CSS Backgrounds and Borders Module Level 3
border-left-color
Syntax
border-left-color: color
Initial value CurrentColor
Applies to all elements
Inherited no
See Also
  • Color
Specification
  • CSS Backgrounds and Borders Module Level 3
border-left-style
Syntax
border-left-style: none | hidden | solid | dashed | dotted | double | groove | ridge | inset | outset
Initial value none
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
border-left-width
Syntax
border-left-width: thin | medium | thick | length
Initial value medium
Applies to all elements
Inherited no
Comments

Even though the initial value for this property is medium, no left border will be shown by default as the initial value for border-left-style is none.

Specification
  • CSS Backgrounds and Borders Module Level 3
border-radius
Syntax
border-radius: [ length | percent ] {1..2}
Initial value 0
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
border-bottom-left-radius
Syntax
border-bottom-left-radius: [ length | percent ] {1..2}
Initial value 0
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
border-bottom-right-radius
Syntax
border-bottom-right-radius: [ length | percent ] {1..2}
Initial value 0
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
border-top-left-radius
Syntax
border-top-left-radius: [ length | percent ] {1..2}
Initial value 0
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
border-top-right-radius
Syntax
border-top-right-radius: [ length | percent ] {1..2}
Initial value 0
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
border-right
Syntax
border-right: color || border-style || border-width
Initial value none
Applies to all elements
Inherited no
Comments

The border-right property is a shorthand for setting the following CSS properties:

  • border-right-color
  • border-right-style
  • border-right-width
Specification
  • CSS Backgrounds and Borders Module Level 3
border-right-color
Syntax
border-right-color: color
Initial value CurrentColor
Applies to all elements
Inherited no
See Also
  • Color
Specification
  • CSS Backgrounds and Borders Module Level 3
border-right-style
Syntax
border-right-style: none | hidden | solid | dashed | dotted | double | groove | ridge | inset | outset
Initial value none
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
border-right-width
Syntax
border-right-width: thin | medium | thick | length
Initial value medium
Applies to all elements
Inherited no
Comments

Even though the initial value for this property is medium, no right border will be shown by default as the initial value for border-right-style is none.

Specification
  • CSS Backgrounds and Borders Module Level 3
border-spacing
Syntax
border-spacing: length {1..2}
Initial value 0
Applies to all elements
Inherited no
Comments

This property determines the spacing between table cell borders for tables that use the separated table border model. See the Tables documentation for more details.

Specification
  • CSS 2.1
border-style
Syntax
border-style: border-style {1..4}
Initial value none
Applies to all elements
Inherited no
Comments

The border-style property is a shorthand for setting the following CSS properties:

  • border-bottom-style
  • border-left-style
  • border-right-style
  • border-top-style
Specification
  • CSS Backgrounds and Borders Module Level 3
border-top
Syntax
border-top: color || border-style || border-width
Initial value none
Applies to all elements
Inherited no
Comments

The border-top property is a shorthand for setting the following CSS properties:

  • border-top-color
  • border-top-style
  • border-top-width
Specification
  • CSS Backgrounds and Borders Module Level 3
border-top-color
Syntax
border-top-color: color
Initial value CurrentColor
Applies to all elements
Inherited no
See Also
  • Color
Specification
  • CSS Backgrounds and Borders Module Level 3
border-top-style
Syntax
border-top-style: none | hidden | solid | dashed | dotted | double | groove | ridge | inset | outset
Initial value none
Applies to all elements
Inherited no
Specification
  • CSS Backgrounds and Borders Module Level 3
border-top-width
Syntax
border-top-width: thin | medium | thick | length
Initial value medium
Applies to all elements
Inherited no
Comments

Even though the initial value for this property is medium, no top border will be shown by default as the initial value for border-top-style is none.

Specification
  • CSS Backgrounds and Borders Module Level 3
border-width
Syntax
border-width: [ thin | medium | thick | length ] {1..4}
Initial value medium
Applies to all elements
Inherited no
Comments

The border-width property is a shorthand for setting the following CSS properties:

  • border-bottom-width
  • border-left-width
  • border-right-width
  • border-top-width
Specification
  • CSS Backgrounds and Borders Module Level 3
bottom
Syntax
bottom: auto | length | percent
Initial value auto
Applies to positioned elements
Inherited no
Comments

This property determines the bottom offset for positioned elements (ie. elements with a position value of relative, absolute or fixed).

Specification
  • CSS 2.1
box-decoration-break
Syntax
box-decoration-break: slice | clone
Initial value clone
Applies to block elements and tables
Inherited no
Comments

This property is only supported on block elements and tables. Also note that Prince defaults to clone.

Specification
  • CSS Fragmentation Module Level 3
box-sizing
Syntax
box-sizing: content-box | padding-box | border-box
Initial value content-box
Applies to all elements
Inherited no
Specification
  • CSS Basic User Interface Module Level 3 (CSS3 UI)
break-after
Syntax
break-after: auto | avoid | avoid-page | avoid-column | page | left | right | recto | verso | column
Initial value auto
Applies to block-level elements in the normal flow of the root element
Inherited no
Comments

This property can be used to force or suppress page breaks after an element.

The values avoid-page and avoid-column each behave as simply avoid: it is not possible to avoid page breaks without also avoiding column breaks.

See the documentation for Page breaks for more details.

Specification
  • CSS Fragmentation Module Level 3
break-before
Syntax
break-before: auto | avoid | avoid-page | avoid-column | page | left | right | recto | verso | column
Initial value auto
Applies to block-level elements in the normal flow of the root element
Inherited no
Comments

This property can be used to force or suppress page breaks before an element.

The values avoid-page and avoid-column each behave as simply avoid: it is not possible to avoid page breaks without also avoiding column breaks.

See the documentation for Page breaks for more details.

Specification
  • CSS Fragmentation Module Level 3
break-inside
Syntax
break-inside: auto | avoid | avoid-page | avoid-column
Initial value auto
Applies to block-level elements in the normal flow of the root element
Inherited no
Comments

This property can be used to suppress page breaks inside an element. See the documentation for Page breaks for more details.

Specification
  • CSS Fragmentation Module Level 3
caption-page*
Syntax
caption-page: first | following | all
Initial value first
Applies to table elements
Inherited yes
Comments

This property determines whether table captions will be displayed on the first page of a table, or only on following pages, or repeated on every page that a table appears on.

The property prince-caption-page can be used as an alias.

See Also
  • Table captions
caption-side
Syntax
caption-side: top | bottom
Initial value top
Applies to table-caption elements
Inherited yes
Comments

This property determines whether table captions will be displayed at the top or bottom of the table.

See Also
  • Table captions
Specification
  • CSS 2.1
clear
Syntax
clear: none | left | right | inside | outside | both
Initial value none
Applies to block-level elements
Inherited no
Comments

This property determines whether an element should be moved down the page in order to clear elements that have been floated to the left or right of the page. The left, right, inside and outside values correspond to values given to the float property, while both will clear floats on either side.

Specification
  • CSS 2.1
  • CSS Figures
clip
Syntax
clip: auto | rect( offset, offset, offset, offset )
Initial value auto
Applies to absolutely positioned elements
Inherited no
Comments

This property determines the clipping rectangle for absolutely positioned elements (ie. elements with a position value of absolute or fixed).

Specification
  • CSS 2.1
clip-path
Syntax
clip-path: none | url( path )
Initial value none
Applies to SVG elements
Inherited no
Comments

The clip-path property only applies to SVG elements.

Specification
  • SVG 1.1
clip-rule
Syntax
clip-rule: nonzero | evenodd
Initial value nonzero
Applies to SVG elements
Inherited yes
Comments

The clip-rule property only applies to SVG elements.

Specification
  • SVG 1.1
color
Syntax
color: color
Initial value black
Applies to all elements
Inherited yes
Comments

See the Color section for supported color values.

See Also
  • Color
Specification
  • CSS Color Module Level 3
column-break-after
Syntax
column-break-after: auto | always
Initial value auto
Applies to multicol elements
Inherited no
Comments

This property is deprecated. Use break-after:column instead. See the documentation for Columns for more details.

See Also
  • break-after
column-break-before
Syntax
column-break-before: auto | always
Initial value auto
Applies to multicol elements
Inherited no
Comments

This property is deprecated. Use break-before:column instead. See the documentation for Columns for more details.

See Also
  • break-before
column-count
Syntax
column-count: auto | number
Initial value 1
Applies to non-replaced block-level elements (except table elements), table cells, and inline-block elements
Inherited no
See Also
  • Columns
Specification
  • CSS Multi-column Layout Module
column-fill
Syntax
column-fill: auto | balance
Initial value balance
Applies to multicol elements
Inherited no
See Also
  • Columns
Specification
  • CSS Multi-column Layout Module
column-gap
Syntax
column-gap: length | percent | normal
Initial value normal
Applies to multicol elements
Inherited no
See Also
  • Columns
Specification
  • CSS Multi-column Layout Module
column-rule
Syntax
column-rule: column-rule-color || column-rule-style || column-rule-width
Initial value none
Applies to multicol elements
Inherited no
Comments

The column-rule property is a shorthand for setting the following CSS properties:

  • column-rule-color
  • column-rule-style
  • column-rule-width
See Also
  • Columns
Specification
  • CSS Multi-column Layout Module
column-rule-color
Syntax
column-rule-color: color
Initial value CurrentColor
Applies to multicol elements
Inherited no
See Also
  • Columns
  • Color
Specification
  • CSS Multi-column Layout Module
column-rule-style
Syntax
column-rule-style: none | solid | dashed | dotted | double | groove | ridge | inset | outset
Initial value none
Applies to multicol elements
Inherited no
See Also
  • Columns
Specification
  • CSS Multi-column Layout Module
column-rule-width
Syntax
column-rule-width: thin | medium | thick | length
Initial value medium
Applies to multicol elements
Inherited no
Comments

Even though the initial value for this property is medium, no column rule will be shown by default as the initial value for column-rule-style is none.

See Also
  • Columns
Specification
  • CSS Multi-column Layout Module
column-span
Syntax
column-span: number | all
Initial value 1
Applies to in-flow block-level elements
Inherited no
Comments

A numeric column-span will only affect column floats.

See Also
  • Columns
Specification
  • CSS Multi-column Layout Module
column-width
Syntax
column-width: auto | width
Initial value auto
Applies to non-replaced block-level elements (except table elements), table cells, and inline-block elements
Inherited no
See Also
  • Columns
Specification
  • CSS Multi-column Layout Module
columns
Syntax
columns: column-count | column-width
Initial value 1
Applies to non-replaced block-level elements (except table elements), table cells, and inline-block elements
Inherited no
Comments

The columns property is a shorthand for setting the following CSS properties:

  • column-count
  • column-width
See Also
  • Columns
Specification
  • CSS Multi-column Layout Module
content
Syntax
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-counters( url, counter, "separator", counter-style? ) | target-content( url ) | leader( "..." | dotted | solid | space ) | string( ident, page-policy? ) | content(  ) | prince-base-url(  ) | prince-script( ident, content? ) | prince-glyph-index( number ) | prince-fallback( url ) [ , content+ ]? | element( name ) ]+
Initial value normal
Applies to all elements, tree-abiding pseudo-elements, and page regions
Inherited no
Comments

The content property can be used to insert text and other content into the original document. The uses are very wide-ranging and are treated in more depth in the Generated Content section.

Several ways of creating content are here defined by means of functions - the detailed explanation can be found in the Generated Content Functions section.

See Also
  • Generated Content Functions
  • Generated Content
  • Generated content in page regions
  • Copying content from the document
  • Taking elements from the document
  • Counters and Numbering
  • Cross-references
Specification
  • CSS Generated Content Module Level 3
  • CSS Generated Content for Paged Media Module
  • CSS Books
counter-increment
Syntax
counter-increment: none | [ name number? ]+
Initial value none
Applies to all elements
Inherited no
Comments

For information about the use of the counter-increment property see the documentation for Counters and Numbering.

Specification
  • CSS 2.1
counter-reset
Syntax
counter-reset: none | [ name number? ]+
Initial value none
Applies to all elements
Inherited no
Comments

For information about the use of the counter-reset property see the documentation for Counters and Numbering.

Specification
  • CSS 2.1
direction
Syntax
direction: ltr | rtl
Initial value ltr
Applies to all elements
Inherited yes
Specification
  • CSS Writing Modes Level 3
display
Syntax
display: inline | block | flex | inline-flex | 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
Initial value inline
Applies to all elements
Inherited no
See Also
  • Display
Specification
  • CSS 2.1
  • CSS Flexible Box Layout Module Level 1
dominant-baseline
Syntax
dominant-baseline: auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge
Initial value auto
Applies to SVG elements
Inherited no
Comments

The dominant-baseline property only applies to SVG text elements.

Specification
  • SVG 1.1
empty-cells
Syntax
empty-cells: show | hide
Initial value show
Applies to table-cell elements
Inherited yes
Specification
  • CSS 2.1
fill
Syntax
fill: none | color | url( paint-server )
Initial value black
Applies to SVG elements
Inherited yes
Comments

The fill property only applies to SVG elements.

Specification
  • SVG 1.1
fill-opacity
Syntax
fill-opacity: number
Initial value 1
Applies to SVG elements
Inherited yes
Comments

The fill-opacity property only applies to SVG elements.

Specification
  • SVG 1.1
fill-rule
Syntax
fill-rule: nonzero | evenodd
Initial value nonzero
Applies to SVG elements
Inherited yes
Comments

The fill-rule property only applies to SVG elements.

Specification
  • SVG 1.1
filter
Syntax
filter: none | [ url( url ) | blur( length ) | brightness( number | percent ) | contrast( number | percent ) | drop-shadow( length {1..3}, color? ) | grayscale( number | percent ) | hue-rotate( angle ) | invert( number | percent ) | opacity( number | percent ) | saturate( number | percent ) | sepia( number | percent ) ]+
Initial value none
Applies to all elements
Inherited no
Comments

The filter property provides graphical effects like blurring, saturating or color shifting an element. For more details see the Filters section.

See Also
  • Filters
Specification
  • Filter Effects Module Level 1
flex
Syntax
flex: none | [ flex-grow flex-shrink? || flex-basis ]
Initial value 1 0 auto
Applies to flex items
Inherited no
Comments

The flex property is a shorthand for setting the following CSS properties:

  • flex-grow
  • flex-shrink
  • flex-basis
Specification
  • CSS Flexible Box Layout Module Level 1
flex-basis
Syntax
flex-basis: content | width
Initial value auto
Applies to flex containers
Inherited no
Specification
  • CSS Flexible Box Layout Module Level 1
flex-direction
Syntax
flex-direction: row | row-reverse | column | column-reverse
Initial value row
Applies to flex containers
Inherited no
Specification
  • CSS Flexible Box Layout Module Level 1
flex-grow
Syntax
flex-grow: number
Initial value 0
Applies to flex items
Inherited no
Specification
  • CSS Flexible Box Layout Module Level 1
flex-shrink
Syntax
flex-shrink: number
Initial value 1
Applies to flex items
Inherited no
Specification
  • CSS Flexible Box Layout Module Level 1
flex-wrap
Syntax
flex-wrap: nowrap | wrap | wrap-reverse
Initial value nowrap
Applies to flex containers
Inherited no
Specification
  • CSS Flexible Box Layout Module Level 1
flex-flow
Syntax
flex-flow: flex-direction || flex-wrap
Initial value row nowrap
Applies to flex containers
Inherited no
Comments

The flex-flow property is a shorthand for setting the following CSS properties:

  • flex-direction
  • flex-wrap
Specification
  • CSS Flexible Box Layout Module Level 1
float
Syntax
float:
   none | left | right | inside | outside    | footnote | inline-footnote    | prince-column-footnote    | prince-column-inline-footnote    | prince-snap    | [ [ top | bottom | column-top | column-bottom          | column-top-corner | column-bottom-corner ]        && [ next | unless-fit ]? ]
Initial value none
Applies to all elements
Inherited no
Comments

Traditionally, floats move in the inline direction, left or right. Prince extends this behavior with page floats that move in the block direction, specifying that an element should be floated to the top or to the bottom, or to the nearest edge of the column.

The values top or bottom float the element to, respectively, the top or the bottom of the page.

The values column-top and column-bottom float the element to the top or bottom of the column it appears in.

The values column-top-corner and column-bottom-corner float the element to the top or bottom of the last column, rather than its natural column.

The value prince-snap floats the element to the nearest "end", i.e. to the top or bottom of the page, or of the column in the case of a multi-column layout.

The values inside and outside float the element respectively to the inside or outside of a spread: inside moves the element to the right when used on a left-facing page, and to the left on a right-facing page; outside moves the element to the left when used on a left-facing page, and to the right on a right-facing page. When these values are used in a multi-column layout, the element is floated to the inside or outside of the column it appears in its natural flow.

The value footnote transforms the element into a footnote - the footnote marker is placed outside of the block of the footnote. The value inline-footnote transforms the element into a footnote and places the footnote marker inside of the block of the footnote.

The values prince-column-footnote and prince-column-inline-footnote behave in an analogous way, but move the footnote not to the bottom of the page, but to the bottom of its column instead.

The additional modifier next defers the float to the next column in a multi-column layout, otherwise it defers the float to the next page.

The modifier unless-fit expresses a conditional: the element is only floated if it would otherwise cause a page or column break.

See Also
  • Floats
Specification
  • CSS 2.1
  • CSS Generated Content for Paged Media Module
  • CSS Figures
  • CSS Books
flow*
Syntax
flow: normal | static( name, [ start | current ]? )
Initial value normal
Applies to all elements
Inherited no
Comments

This property is used to remove elements from the normal flow of the document, to be placed in a page region with content: flow(), in order to create running page headers and footers.

The optional start argument (default is current) makes the fetched content available, as if it were fetched from the start of the document.

See the documentation for Taking elements from the document for more details.

The property prince-flow can be used as an alias.

See Also
  • Page regions
  • Taking elements from the document
  • content
Specification
  • CSS Books
font
Syntax
font: font-style? font-variant? font-weight? font-size [ / line-height ]? font-family
Initial value 12pt serif
Applies to all elements
Inherited yes
Examples
font: bold 14pt/16pt Georgia, "Times New Roman", serif
Comments

The font property is a shorthand for setting the following CSS properties:

  • font-family
  • font-size
  • font-stretch
  • font-style
  • font-variant
  • font-weight
  • line-height
See Also
  • Text formatting
Specification
  • CSS 2.1
font-family
Syntax
font-family: [ serif | sans-serif | monospace | name | "name" ]# prince-no-fallback?
Initial value serif
Applies to all elements
Inherited yes
Examples
font-family: Georgia, "Times New Roman", serif
font-family: MyFont, prince-no-fallback
Comments

The special keyword prince-no-fallback triggers a warning if any glyphs are not found in the specified font, whereas normally Prince would silently fallback to serif.

When used as a descriptor for the @font-face at-rule, font-family defines the font family name that will be used in all CSS font family name matching. It is required for the @font-face rule to be valid.

See Also
  • Fonts
  • Redefining the generic font families
  • Text formatting
Specification
  • CSS 2.1
font-size
Syntax
font-size: length | percent | smaller | larger | xx-small | x-small | small | medium | large | x-large | xx-large
Initial value 12pt
Applies to all elements
Inherited yes
See Also
  • Text formatting
Specification
  • CSS 2.1
font-stretch
Syntax
font-stretch: ultra-condensed | extra-condensed | condensed | semi-condensed | normal | semi-expanded | expanded | extra-expanded | ultra-expanded | wider | narrower
Initial value normal
Applies to all elements
Inherited yes
Comments

The font-stretch property is not supported for system fonts on Windows.

See Also
  • Text formatting
Specification
  • CSS Fonts Module Level 3
font-style
Syntax
font-style: normal | italic
Initial value normal
Applies to all elements
Inherited yes
See Also
  • Text formatting
Specification
  • CSS 2.1
font-variant
Syntax
font-variant: normal | small-caps | prince-no-kerning | prince-opentype( [ feature ]+ )
Initial value normal
Applies to all elements
Inherited yes
Examples
<span style="font-family: SpecialFont; font-variant: prince-opentype(aalt(2))">&amp;</span>
font-variant: prince-opentype(onum, ccmp, liga)
Comments

The prince-opentype() function takes a comma-separated list of OpenType features. Microsoft has a list of the OpenType feature names here.

Some OpenType features like aalt (access all alternates) can be used to select one of many optional glyphs, eg. a font might provide three different ampersand glyphs and allow the author to choose which one. An optional integer parameter is how you do this, however it requires intimate details of exactly which font is being used and what glyphs it provides.

The feature can be written either in function form (feature(N)) or in concatenated form (featureN).

The keyword prince-no-kerning disables the kern OpenType feature, which defines font kerning.

See Also
  • Typographic Ligatures
  • OpenType Features in Prince
Specification
  • CSS 2.1
font-weight
Syntax
font-weight: normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
Initial value normal
Applies to all elements
Inherited yes
See Also
  • Text formatting
Specification
  • CSS 2.1
footnote-display
Syntax
footnote-display: block | inline | compact
Initial value block
Applies to footnote elements
Inherited no
Comments

This property provides a convenient way of determining whether footnotes should be displayed as a block element or an inline element.

The value compact leaves it up to Prince to determine whether to display the footnote as a block or inline element: if two or more footnotes fit on one line, they will be treated as inline elements to take up less space.

Specification
  • CSS Generated Content for Paged Media Module
footnote-style-position*
Syntax
footnote-style-position: outside | inside
Initial value outside
Applies to footnote elements
Inherited yes
Comments

For information about the use of the footnote-style-position property see the documentation for Footnotes.

height
Syntax
height: auto | length | percent | min-content | max-content
Initial value auto
Applies to all elements except non-replaced inline elements, table columns, and column groups
Inherited no
Comments

The values min-content and max-content do not affect auto table layout.

Specification
  • CSS 2.1
  • CSS Intrinsic & Extrinsic Sizing Module Level 3
hyphens
Syntax
hyphens: none | manual | auto
Initial value manual
Applies to all elements
Inherited yes
Comments

This property defines if hyphenation is allowed to create more wrapping points in a line of text.

See Also
  • Hyphenation
Specification
  • CSS Text Module Level 3
hyphenate-patterns*
Syntax
hyphenate-patterns: none | url( patterns-url )
Initial value none
Applies to all elements
Inherited yes
Comments

This property is used to point to a hyphenation dictionary. Normally this is selected automatically, based on the current language.

The property prince-hyphenate-patterns can be used as an alias.

See Also
  • Hyphenation
hyphenate-after*
Syntax
hyphenate-after: integer
Initial value 1
Applies to all elements
Inherited yes
Comments

This property specifies the minimum number of letters in a word that may be moved to the next line when the word is hyphenated.

The property prince-hyphenate-after can be used as an alias.

See Also
  • Hyphenation
hyphenate-before*
Syntax
hyphenate-before: integer
Initial value 1
Applies to all elements
Inherited yes
Comments

This property specifies the minimum number of letters in a word that may be left at the end of a line when the word is hyphenated.

The property prince-hyphenate-before can be used as an alias.

See Also
  • Hyphenation
hyphenate-character*
Syntax
hyphenate-character: auto | "string"
Initial value auto
Applies to all elements
Inherited yes
Comments

This property specifies the character that is shown at the end of a line when the word is hyphenated.

The property prince-hyphenate-character can be used as an alias.

See Also
  • Hyphenation
hyphenate-lines*
Syntax
hyphenate-lines: no-limit | integer
Initial value no-limit
Applies to all elements
Inherited yes
Comments

This property specifies the maximum number of consecutive lines that may end with a hyphenated word.

The property prince-hyphenate-limit-lines can be used as an alias.

See Also
  • Hyphenation
Specification
  • CSS Text Module Level 4
image-resolution*
Syntax
image-resolution: dpi | normal | auto [ , normal | dpi ]?
Initial value normal
Applies to image elements
Inherited yes
Comments

This property determines the resolution of an image. The value normal means 96dpi, or else the current CSS DPI setting. A custom DPI value can also be specified. The value auto means to check the original resolution of the image. One can specify a second value, as for example auto, normal or auto, 300dpi in order to check the original resolution of the image first, and to fall back on the second value if the image doesn't contain resolution information.

The property prince-image-resolution can be used as an alias.

See Also
  • Image Size
image-orientation
Syntax
image-orientation: none | from-image
Initial value none
Applies to all elements
Inherited yes
Comments

This property adds support for the orientation field in the EXIF data of JPEG and TIFF images.

The property applies only to content images (e.g. replaced elements and generated content), not decorative images (such as background-image).

Specification
  • CSS Images Module Level 3 - Editor's Draft
justify-content
Syntax
justify-content: flex-start | flex-end | center | space-between | space-around
Initial value flex-start
Applies to flex containers
Inherited no
Specification
  • CSS Flexible Box Layout Module Level 1
left
Syntax
left: auto | length | percent
Initial value auto
Applies to positioned elements
Inherited no
Comments

This property determines the left offset for positioned elements (ie. elements with a position value of relative, absolute or fixed).

Specification
  • CSS 2.1
letter-spacing
Syntax
letter-spacing: normal | length
Initial value normal
Applies to all elements
Inherited yes
Specification
  • CSS Text Module Level 3
line-stacking-strategy
Syntax
line-stacking-strategy: inline-line-height | block-line-height | max-height | grid-height
Initial value inline-line-height
Applies to block-level elements
Inherited yes
Comments

This property allows to choose whether individual lines should have their height determined based on their content, or whether all lines in a paragraph should have the same height, or a compromise where their heights are determined by their content and then rounded up to a multiple of the paragraph line height.

The behavior define by inline-line-height is the default.

The value block-line-height uses the line-height of the block element and ignores the actual height of the content on those lines, so lines will always have the same spacing regardless of whether they contain spans with larger font size of superscripts/subscripts.

The value grid-height is like inline-line-height but each line gets rounded up to an integer multiple of the block line-height.

Finally, the max-height value works like inline-line-height, but it ignores the line-height property value for inline elements.

See Also
  • Paragraph formatting
  • line-height
Specification
  • CSS3 module: line (WD 15 May 2002)
line-height
Syntax
line-height: normal | none | number | length | percent
Initial value normal
Applies to all elements
Inherited yes
See Also
  • Paragraph formatting
Specification
  • CSS 2.1
link*
Syntax
link: none | url( target-url ) | attr( target-attr )
Initial value none
Applies to all elements
Inherited no
Comments

This property makes an element into a link to the specified URL.

The property prince-link can be used as an alias.

See Also
  • PDF Links
list-style
Syntax
list-style: list-style-image || list-style-position || list-style-type
Initial value outside disc
Applies to list items
Inherited yes
Comments

The list-style property is a shorthand for setting the following CSS properties:

  • list-style-image
  • list-style-position
  • list-style-type
See Also
  • Lists
Specification
  • CSS 2.1
list-style-image
Syntax
list-style-image: none | url( image-url )
Initial value none
Applies to list items
Inherited yes
See Also
  • Lists
Specification
  • CSS 2.1
list-style-position
Syntax
list-style-position: outside | inside
Initial value outside
Applies to list items
Inherited yes
See Also
  • Lists
Specification
  • CSS 2.1
list-style-type
Syntax
list-style-type: box | check | circle | diamond | disc | hyphen | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-alpha | lower-latin | upper-alpha | upper-latin | lower-hexadecimal | upper-hexadecimal | binary | octal | asterisks | arabic-indic | lower-greek | upper-greek | lower-norwegian | upper-norwegian | lower-russian | upper-russian | lower-ukrainian | upper-ukrainian | lower-belarusian | upper-belarusian | lower-bulgarian | upper-bulgarian | lower-serbian | upper-serbian | persian | urdu | japanese-informal | japanese-formal | cjk-decimal | simp-chinese-informal | simp-chinese-formal | trad-chinese-informal | trad-chinese-formal
Initial value disc
Applies to list items
Inherited yes
See Also
  • Lists
  • Counters and Numbering
Specification
  • CSS 2.1
margin
Syntax
margin: [ auto | length | percent ] {1..4}
Initial value 0
Applies to all elements, except elements with table display types other than table-caption, table and inline-table
Inherited no
Comments

The margin property is a shorthand for setting the following CSS properties:

  • margin-bottom
  • margin-inside
  • margin-left
  • margin-outside
  • margin-right
  • margin-top
See Also
  • Margin
Specification
  • CSS 2.1
margin-bottom
Syntax
margin-bottom: auto | length | percent
Initial value 0
Applies to all elements, except elements with table display types other than table-caption, table and inline-table
Inherited no
See Also
  • Margin
Specification
  • CSS 2.1
margin-inside*
Syntax
margin-inside: auto | length | percent
Initial value auto
Applies to all elements, except elements with table display types other than table-caption, table and inline-table
Inherited no
Comments

The margin-inside property overrides the value of the margin-right property if the element is on a left-facing page and overrides the value of the margin-left property if the element is on a right-facing page. The result is a horizontal margin on the side of the element that is on the "inside" of the two-page spread.

See Also
  • Margin
margin-left
Syntax
margin-left: auto | length | percent
Initial value 0
Applies to all elements, except elements with table display types other than table-caption, table and inline-table
Inherited no
See Also
  • Margin
Specification
  • CSS 2.1
margin-outside*
Syntax
margin-outside: auto | length | percent
Initial value auto
Applies to all elements, except elements with table display types other than table-caption, table and inline-table
Inherited no
Comments

The margin-outside property overrides the value of the margin-left property if the element is on a left-facing page and overrides the value of the margin-right property if the element is on a right-facing page. The result is a horizontal margin on the side of the element that is on the "outside" of the two-page spread.

See Also
  • Margin
margin-right
Syntax
margin-right: auto | length | percent
Initial value 0
Applies to all elements, except elements with table display types other than table-caption, table and inline-table
Inherited no
See Also
  • Margin
Specification
  • CSS 2.1
margin-top
Syntax
margin-top: auto | length | percent
Initial value 0
Applies to all elements, except elements with table display types other than table-caption, table and inline-table
Inherited no
See Also
  • Margin
Specification
  • CSS 2.1
marker-start
Syntax
marker-start: none | url( marker-url )
Initial value none
Applies to SVG elements
Inherited
Comments

The marker-start property only applies to SVG elements.

Specification
  • SVG 1.1
marker-mid
Syntax
marker-mid: none | url( marker-url )
Initial value none
Applies to SVG elements
Inherited
Comments

The marker-mid property only applies to SVG elements.

Specification
  • SVG 1.1
marker-end
Syntax
marker-end: none | url( marker-url )
Initial value none
Applies to SVG elements
Inherited
Comments

The marker-end property only applies to SVG elements.

Specification
  • SVG 1.1
marks
Syntax
marks: none | [ crop || cross ]
Initial value none
Applies to @page at-rule
Inherited
Examples
@page { marks: crop }
@page { marks: crop cross }
Comments

This CSS at-rule descriptor, used with the @page at-rule, adds crop and/or cross marks to the page.

Specifying crop and/or cross for the marks property will result in 6pt of bleed area being added to all four sides of the page and additional trim area to contain the crop marks.

See Also
  • prince-mark-length
  • prince-mark-offset
  • prince-mark-width
Specification
  • CSS Paged Media Module Level 3
mask
Syntax
mask: url( mask )
Initial value none
Applies to all elements
Inherited no
Comments

The mask property is used to partially or fully hide an element by masking it with a provided image.

Specification
  • SVG 1.1
max-height
Syntax
max-height: none | length | percent
Initial value none
Applies to all elements but non-replaced inline elements, table columns, and column groups
Inherited no
Specification
  • CSS 2.1
max-width
Syntax
max-width: none | length | percent
Initial value none
Applies to all elements but non-replaced inline elements, table rows, and row groups
Inherited no
Specification
  • CSS 2.1
min-height
Syntax
min-height: auto | length | percent
Initial value 0
Applies to all elements but non-replaced inline elements, table columns, and column groups
Inherited no
Specification
  • CSS 2.1
  • CSS Flexible Box Layout Module Level 1
min-width
Syntax
min-width: auto | length | percent
Initial value 0
Applies to all elements but non-replaced inline elements, table rows, and row groups
Inherited no
Specification
  • CSS 2.1
  • CSS Flexible Box Layout Module Level 1
object-position
Syntax
object-position:
   [ [ left | center | right ] || [ top | center | bottom ] ]    | [ left | center | right | length | percent ] [ top | center | bottom | length | percent ]?    | [ [ left | right ] [ length | percent ] && [ top | bottom ] [ length | percent ] ]
Initial value 50% 50%
Applies to replaced elements
Inherited no
Comments

This property specifies how the contents of a replaced element, such as an image, are positioned in its container.

Specification
  • CSS Images Module Level 3
opacity
Syntax
opacity: number
Initial value 1
Applies to all elements
Inherited no
Comments

Opacity is a number between 0 and 1.

Specification
  • CSS Color Module Level 3
order
Syntax
order: integer
Initial value 0
Applies to flex items and absolutely-positioned children of flex containers
Inherited no
Specification
  • CSS Flexible Box Layout Module Level 1
orphans
Syntax
orphans: integer
Initial value 1
Applies to block container elements
Inherited yes
Comments

If a paragraph is split over two pages or columns, this property determines the minimum number of lines that must be left at the bottom of the first page or column.

See Also
  • Widows and orphans
  • widows
Specification
  • CSS 2.1
  • CSS Multi-column Layout Module
overflow
Syntax
overflow: visible | hidden
Initial value visible
Applies to non-replaced block-level elements and non-replaced inline-block elements
Inherited no
Comments

This property determines the visibility of content that overflows outside the boundaries of an element.

Specification
  • CSS 2.1
overflow-wrap
Syntax
overflow-wrap: normal | break-word
Initial value normal
Applies to all elements
Inherited yes
Examples
part { overflow-wrap: break-word; }
supplier, item { overflow-wrap: normal; }
<part><supplier>xyz</supplier><item>12345</item></part>
Comments

This property controls wrapping behavior of last resort: whether it is better for a word to overflow its container, or to be broken at an arbitrary point (subject to white-space, and not splitting within a grapheme cluster), without adding a hyphen.

The value normal allows text containing no other wrap opportunities to overflow.

This feature is most commonly used for non-words such as URIs, part codes, or cryptographic hashes. For such purposes, overflow-wrap:break-word can be compared with word-break:break-all: the latter is more willing to break the word (preferring to break than to leave an under-full line or advance past a CSS2-style float), but only breaks between alpha-numeric grapheme clusters rather than between any pair of grapheme clusters.

The element whose overflow-wrap property controls whether such a wrap opportunity exists at a given boundary is the closest ancestor that “strictly contains” the boundary, i.e. that contains text from both sides of the boundary. Thus, components of a wrappable string can be kept on one line by styling each component with overflow-wrap:normal even if two components are directly adjacent to each other, as seen in the above example.

See Also
  • Paragraph formatting
  • word-break
  • prince-wrap-inside
  • white-space
Specification
  • CSS Text Module Level 3
padding
Syntax
padding: [ length | percent ] {1..4}
Initial value 0
Applies to all elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
Inherited no
Comments

The padding property is a shorthand for setting the following CSS properties:

  • padding-bottom
  • padding-left
  • padding-right
  • padding-top
See Also
  • Padding
Specification
  • CSS 2.1
padding-bottom
Syntax
padding-bottom: length | percent
Initial value 0
Applies to all elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
Inherited no
See Also
  • Padding
Specification
  • CSS 2.1
padding-left
Syntax
padding-left: length | percent
Initial value 0
Applies to all elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
Inherited no
See Also
  • Padding
Specification
  • CSS 2.1
padding-right
Syntax
padding-right: length | percent
Initial value 0
Applies to all elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
Inherited no
See Also
  • Padding
Specification
  • CSS 2.1
padding-top
Syntax
padding-top: length | percent
Initial value 0
Applies to all elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
Inherited no
See Also
  • Padding
Specification
  • CSS 2.1
page
Syntax
page: auto | name
Initial value auto
Applies to all elements
Inherited yes
Comments

This property determines which named page, if any, the current element should be placed on. See the documentation for Selecting pages for more details.

Specification
  • CSS Paged Media Module Level 3
page-break-after
Syntax
page-break-after: auto | always | avoid | left | right | verso | recto
Initial value auto
Applies to block-level elements in the normal flow of the root element
Inherited no
Comments

This property can be used to force or suppress page breaks after an element. Prince expands the property with the values verso and recto.

This property is deprecated. Use the property break-after instead. See the documentation for Page breaks for more details.

See Also
  • break-after
Specification
  • CSS 2.1
page-break-before
Syntax
page-break-before: auto | always | avoid | left | right | verso | recto
Initial value auto
Applies to block-level elements in the normal flow of the root element
Inherited no
Comments

This property can be used to force or suppress page breaks before an element. Prince expands the property with the values verso and recto.

This property is deprecated. Use the property break-before instead. See the documentation for Page breaks for more details.

See Also
  • break-before
Specification
  • CSS 2.1
page-break-inside
Syntax
page-break-inside: auto | avoid
Initial value auto
Applies to block-level elements in the normal flow of the root element
Inherited no
Comments

This property can be used to suppress page breaks inside an element.

This property is deprecated. Use the property break-inside instead. See the documentation for Page breaks for more details.

See Also
  • break-inside
Specification
  • CSS 2.1
page-group*
Syntax
page-group: start | auto
Initial value auto
Applies to all elements
Inherited no
Comments

This property determines whether the first page of this element matches the :first page class selector.

The property prince-page-group can be used as an alias.

See Also
  • Page groups
position
Syntax
position: static | relative | absolute | fixed | running( name )
Initial value static
Applies to all elements
Inherited no
Comments

The running() function removes the element from the normal document flow and makes it available to be placed in a page region with the element() function of the content property. See also Taking elements from the document.

See Also
  • Page regions
  • Taking elements from the document
  • content
Specification
  • CSS 2.1
  • CSS Generated Content for Paged Media Module
prince-background-image-resolution*
Syntax
prince-background-image-resolution: dpi | normal | auto [ , normal | dpi ]?
Initial value normal
Applies to background image elements
Inherited yes
Comments

This property determines the resolution of a background image. The value normal means 96dpi, or else the current CSS DPI setting. A custom DPI value can also be specified. The value auto means to check the original resolution of the image. One can specify a second value, as for example auto, normal or auto, 300dpi in order to check the original resolution of the image first, and to fall back on the second value if the image doesn't contain resolution information.

The property background-image-resolution can be used as an alias.

See Also
  • Image Size
prince-bleed*
Syntax
prince-bleed: auto | [ length ] {1..4}
Initial value auto
Applies to @page at-rule
Inherited
Examples
@page { prince-bleed: 10mm }
Comments

This CSS at-rule descriptor can be used to specify the size of the bleed area of the page when crop marks are enabled.

The property bleed can be used as an alias.

See Also
  • Page style
  • prince-trim
prince-bookmark-label*
Syntax
prince-bookmark-label: none | content
Initial value content()
Applies to all elements
Inherited no
Comments

This property is used to determine the text content of the PDF bookmark generated by the current element.

Several ways of creating content are here defined by means of functions - the detailed explanation can be found in the Generated Content Functions section.

Even though the initial value for this property is content(), no PDF bookmark will be generated by default as the initial value for the prince-bookmark-level property is none.

See the documentation for PDF Bookmarks for more details.

The property bookmark-label can be used as an alias.

See Also
  • Generated Content Functions
  • Bookmark labels
  • content
Specification
  • CSS Books
prince-bookmark-level*
Syntax
prince-bookmark-level: none | integer
Initial value none
Applies to all elements
Inherited no
Comments

This property is used to determine the numeric level in the bookmark hierarchy of the PDF bookmark generated by the current element. See the documentation for PDF Bookmarks for more details.

The property bookmark-level can be used as an alias.

See Also
  • Bookmark levels
Specification
  • CSS Books
prince-bookmark-state*
Syntax
prince-bookmark-state: open | closed
Initial value open
Applies to all elements
Inherited no
Comments

This property is used to determine whether the bookmark tree item is open or closed when the PDF is first viewed. In this way you can close each chapter and hide the subsections for documents that are very long, or you can choose to have a deep bookmark tree.

The property bookmark-state can be used as an alias.

See Also
  • Bookmark levels
Specification
  • CSS Books
prince-bookmark-target*
Syntax
prince-bookmark-target: self | url( target-url ) | attr( target-attr )
Initial value self
Applies to all elements
Inherited no
Comments

This property is used to determine the link target for the PDF bookmark generated by the current element. See the documentation for PDF Bookmarks for more details.

The property bookmark-target can be used as an alias.

See Also
  • Bookmark targets
prince-caption-page*
Syntax
prince-caption-page: first | following | all
Initial value first
Applies to table elements
Inherited yes
Comments

This property determines whether table captions will be displayed on the first page of a table, or only on following pages, or repeated on every page that a table appears on.

The property caption-page can be used as an alias.

See Also
  • Table captions
prince-fallback-cmyk-profile*
Syntax
prince-fallback-cmyk-profile: url( filename )
Initial value
Applies to @prince-pdf at-rule
Inherited
Examples
@prince-pdf {
    prince-pdf-output-intent: url("AdobeRGB1998.icc");
	prince-fallback-cmyk-profile: url("ISOcoated_v2_eci.icc");
}
Comments

This property is used inside a @prince-pdf at-rule to determine a fallback CMYK profile to be used for uncalibrated (untagged) CMYK colors or images, if it is not possible to use the output intent ICC profile (see prince-pdf-output-intent).

CMYK colors are treated as uncalibrated in either of the following three cases: conversion of an untagged CMYK image to another color space, conversion of a device dependent CMYK color, or when a PDF Profile requires that only device independent color is present, in which case both untagged CMYK images and device dependent CMYK colors are treated as uncalibrated CMYK colors.

See Also
  • prince-pdf-output-intent
  • Color Management
prince-filter-resolution*
Syntax
prince-filter-resolution: dpi
Initial value 96dpi
Applies to all elements, @prince-pdf at-rule
Inherited
Comments

This property is used to specify the resolution used when rasterizing to images for applying CSS and SVG filters. It can be used for individual elements, or inside a @prince-pdf at-rule. In this latter case, it affects all filters in the document.

See Also
  • Filters
prince-flow*
Syntax
prince-flow: normal | static( name, [ start | current ]? )
Initial value normal
Applies to all elements
Inherited no
Comments

This property is used to remove elements from the normal flow of the document, to be placed in a page region with content: flow(), in order to create running page headers and footers.

The optional start argument (default is current) makes the fetched content available, as if it were fetched from the start of the document.

See the documentation for Taking elements from the document for more details.

The property flow can be used as an alias.

See Also
  • Page regions
  • Taking elements from the document
  • content
Specification
  • CSS Books
prince-footnote-policy*
Syntax
prince-footnote-policy: auto | keep-with-line | keep-with-block
Initial value auto
Applies to footnote elements
Inherited yes
Comments

This property determines whether a footnote should always be displayed on the same page as its footnote call is located on, or whether it may slip to the next page. The value keep-with-line instructs Prince to keep the footnote on the same page as the line with the footnote call, while keep-with-block tells Prince to keep it together with the whole paragraph with the footnote call.

The property must be applied to the paragraph in which the footnote occurs, not to the footnote element itself.

See Also
  • Footnotes
prince-forced-breaks*
Syntax
prince-forced-breaks: short | full
Initial value short
Applies to all elements
Inherited yes
Comments

This property controls whether a line ended by a “preserved newline” (such as introduced by <br>) should preferably appear to be a normal full line (as if ended only by normal line wrapping), or whether being shorter than a normal full line is actually preferable, for example to mark a deliberate break.

The difference is particularly marked in justified text, where lines ended by prince-forced-breaks:full are subject to justification like most other lines.

(Limitation: At the time of writing, this property only affects justified text.)

This property only applies to Prince for Books.

See Also
  • Line breaking
  • The property prince-forced-breaks
  • text-align-last
  • white-space
  • prince-wrap-inside
prince-hyphenate-patterns*
Syntax
prince-hyphenate-patterns: none | url( patterns-url )
Initial value none
Applies to all elements
Inherited yes
Comments

This property is used to point to a hyphenation dictionary. Normally this is selected automatically, based on the current language.

The property hyphenate-patterns can be used as an alias.

See Also
  • Hyphenation
prince-hyphenate-after*
Syntax
prince-hyphenate-after: integer
Initial value 1
Applies to all elements
Inherited yes
Comments

This property specifies the minimum number of letters in a word that may be moved to the next line when the word is hyphenated.

The property hyphenate-after can be used as an alias.

See Also
  • Hyphenation
prince-hyphenate-before*
Syntax
prince-hyphenate-before: integer
Initial value 1
Applies to all elements
Inherited yes
Comments

This property specifies the minimum number of letters in a word that may be left at the end of a line when the word is hyphenated.

The property hyphenate-before can be used as an alias.

See Also
  • Hyphenation
prince-hyphenate-character*
Syntax
prince-hyphenate-character: auto | "string"
Initial value auto
Applies to all elements
Inherited yes
Comments

This property specifies the character that is shown at the end of a line when the word is hyphenated.

The property hyphenate-character can be used as an alias.

See Also
  • Hyphenation
prince-hyphenate-limit-lines*
Syntax
prince-hyphenate-limit-lines: no-limit | integer
Initial value no-limit
Applies to all elements
Inherited yes
Comments

This property specifies the maximum number of consecutive lines that may end with a hyphenated word.

The property hyphenate-lines can be used as an alias.

See Also
  • Hyphenation
Specification
  • CSS Text Module Level 4
prince-hyphenate-lines*
Syntax
prince-hyphenate-lines: no-limit | integer
Initial value no-limit
Applies to all elements
Inherited yes
Comments

This property specifies the maximum number of consecutive lines that may end with a hyphenated word.

The property prince-hyphenate-limit-lines can be used as an alias.

See Also
  • Hyphenation
Specification
  • CSS Text Module Level 4
prince-image-magic*
Syntax
prince-image-magic: none | [ snap-to-integer-coords || ignore-icc-profile || [ jpeg-verbatim | recompress-jpeg( percent ) ] || [ convert-to-jpeg | convert-to-jpeg( percent ) ] ]
Initial value none
Applies to image elements
Inherited yes
Comments

This property performs various image-related, Prince-specific tasks that do not fit into other existing CSS properties. It applies magic to images!

The snap-to-integer-coords value can be used to avoid blurring of images in some PDF viewers.

The ignore-icc-profile value causes Prince to ignore any ICC color profile embedded in the image.

The jpeg-verbatim value inhibits the normal stripping that Prince performs, where unnecessary metadata is removed from JPEG images when they are embedded in the PDF file.

When recompress-jpeg(quality%) is specified for this property, Prince will recompress JPEG images to the specified percentage to save space when embedding them in the PDF output.

The convert-to-jpeg keyword or the convert-to-jpeg(quality%) function convert non-JPEG images to JPEG, so that they take less space (but may look blurry).

Several of the values can be combined, to perform more than one magic on images.

See Also
  • Image Size
  • Image Magic
prince-image-resolution*
Syntax
prince-image-resolution: dpi | normal | auto [ , normal | dpi ]?
Initial value normal
Applies to image elements
Inherited yes
Comments

This property determines the resolution of an image. The value normal means 96dpi, or else the current CSS DPI setting. A custom DPI value can also be specified. The value auto means to check the original resolution of the image. One can specify a second value, as for example auto, normal or auto, 300dpi in order to check the original resolution of the image first, and to fall back on the second value if the image doesn't contain resolution information.

The property image-resolution can be used as an alias.

See Also
  • Image Size
prince-linebreak-magic*
Syntax
prince-linebreak-magic: none | auto
Initial value auto
Applies to all elements
Inherited yes
Comments

This property enables line-breaking in certain situations even in the absence of whitespace. For example, after slashes in long URLs. It can be disabled for situations in which more precise control over line-breaking behavior is preferred.

See Also
  • Paragraph formatting
prince-line-break-choices*
Syntax
prince-line-break-choices: body | heading | title | body-lookahead | heading-lookahead | title-lookahead | fast
Initial value body
Applies to all elements
Inherited yes
Comments

This property is used for fine tuning the line breaking approach.

The keyword title is intended for title pages of books or chapters, where phrasing considerations are of prime consideration even at the cost of extremely unbalanced lines.

The keyword heading, on the other hand, is closer to body, differing mainly in that it's less likely to hyphenate, and is more willing to make the first line(s) a little shorter if doing so avoids a short last line.

The *-lookahead keywords enable paragraph-at-a-time line-breaking for the paragraph in a non-justified paragraph: choosing where to end the line not just based on what seems best for the current line, but also considering the effect on future lines.

The keyword fast can be used for quick web-browers–style line breaking, useful for testing the effect of styling changes that don't depend on good line breaking.

For more details, please see Line breaking.

This property only applies to Prince for Books.

The property prince-text-wrap can be used as an alias.

See Also
  • Line breaking
  • The property prince-line-break-choices
prince-link*
Syntax
prince-link: none | url( target-url ) | attr( target-attr )
Initial value none
Applies to all elements
Inherited no
Comments

This property makes an element into a link to the specified URL.

The property link can be used as an alias.

See Also
  • PDF Links
prince-mark-length*
Syntax
prince-mark-length: length
Initial value 24pt
Applies to @page at-rule
Inherited
Examples
@page { prince-mark-length: 2cm }
Comments

This CSS at-rule descriptor can be used to specify the length of crop marks, beginning after the offset from the page area and extending towards the edge of the paper.

See Also
  • marks
prince-mark-offset*
Syntax
prince-mark-offset: auto | [ length ] {1..4}
Initial value auto
Applies to @page at-rule
Inherited
Examples
@page { prince-mark-offset: 6pt }
Comments

This CSS at-rule descriptor can be used to specify the offset between crop and cross marks and the page area.

See Also
  • marks
prince-mark-width*
Syntax
prince-mark-width: width
Initial value 0.1pt
Applies to @page at-rule
Inherited
Examples
@page { prince-mark-width: 1pt }
Comments

This CSS at-rule descriptor can be used to specify the line width of the crop and cross marks.

See Also
  • marks
prince-n-lines*
Syntax
prince-n-lines: auto | integer? [ longer | shorter ] | change | integer
Initial value auto
Applies to "paragraphs": block container boxes that establish inline formatting contexts
Inherited no
Comments

This property is for use in the pagination phase of typesetting, for ensuring that page ends are even while avoiding widows and other awkward breaks.

Values other than the initial value of auto request that the paragraph occupy the given number of lines; where values other than a simple integer are relative to the number of lines that the paragraph would have occupied if this property still had its initial value (auto).

The value change means to make the paragraph either a line longer or shorter, whichever will be deemed to look better. This value is provided for the common case that a page break opportunity exists both at a line earlier and at a line later than where the page end would naturally fall, as would typically be the case if the only relevant restriction arises from widows:2 or orphans:2 or a minor heading that occupies two body lines worth of height. Thus, this tends to be the most commonly used value for this property, other than leaving at its initial value.

A simple integer value is the least convenient value to use (since choosing the desired number requires counting the existing number of lines, and since this property is most commonly used on long paragraphs). Its value lies in the fact that the result is not subject to variation in "the number of lines that the paragraph would otherwise have had", as can occur if this paragraph spans a page end, and a subsequent styling change causes some earlier content to change in size, affecting what is the last line before the break, and if this in turn affects line-breaking decisions made to avoid having a hyphenation at the end of a page.

This property only applies to Prince for Books.

See Also
  • Spread Balancing
  • The property prince-n-lines
prince-page-fill*
Syntax
prince-page-fill: prefer-balance | prefer-fill
Initial value prefer-fill
Applies to @page at-rule
Inherited no
Comments

This property determines whether Prince should balance text layout on page spreads.

This property only applies to Prince for Books.

See Also
  • Spread Balancing
  • The property prince-n-lines
prince-page-group*
Syntax
prince-page-group: start | auto
Initial value auto
Applies to all elements
Inherited no
Comments

This property determines whether the first page of this element matches the :first page class selector.

The property page-group can be used as an alias.

See Also
  • Page groups
prince-pdf-color-conversion*
Syntax
prince-pdf-color-conversion: none | full
Initial value none
Applies to @prince-pdf at-rule
Inherited no
Comments

This property may be used inside the @prince-pdf at-rule to convert the colors of the PDF to the output intent color space. It functions like the --convert-colors command-line option.

See Also
  • Color conversion
prince-pdf-color-options*
Syntax
prince-pdf-color-options: auto | use-true-black | use-rich-black
Initial value auto
Applies to @prince-pdf at-rule
Inherited no
Examples
@prince-pdf {
    prince-pdf-color-options: use-rich-black;
}
Comments

This property may be used to control the encoding of RGB blacks and grays: when use-true-black is used, they are encoded in the /DeviceGray colorspace in the PDF, instead of /DeviceRGB, whereas use-rich-black disables this behavior and keeps all the colors in RGB. Currently, auto is equivalent to use-true-black.

See Also
  • Rich black and true black
prince-pdf-destination*
Syntax
prince-pdf-destination: none | "name" | attr( attr )
Initial value none
Applies to all elements
Inherited no
Comments

This property may be used to create "named destinations" (nameddest) in generated PDF files which can be linked to from other documents.

See Also
  • PDF Links
prince-pdf-duplex*
Syntax
prince-pdf-duplex: auto | simplex | duplex-flip-short-edge | duplex-flip-long-edge
Initial value auto
Applies to @prince-pdf at-rule
Inherited no
Comments

This property may be used inside the @prince-pdf at-rule to set the Duplex property in the PDFViewerPreferences dictionary.

prince-pdf-event-scripts*
Syntax
prince-pdf-event-scripts:
   none    | [ [ will-close | will-save | did-save | will-print | did-print ] [ "JavaScript" | url ] ]#
Initial value ""
Applies to @prince-pdf at-rule
Inherited
Examples
@prince-pdf {
    prince-pdf-event-scripts: will-close url("onclose.js"), will-print url("onprint.js");
}
Comments

This property can be used to include JavaScript code that will be executed in the PDF when printing, saving, and closing the PDF, known as "Document Action" scripts.

Please be advised that these scripts are dependent on the PDF viewer, and in many cases might only work in Adobe Acrobat products.

See Also
  • PDF Actions
prince-pdf-link-type*
Syntax
prince-pdf-link-type: [ auto | file ]? [ same-window | new-window ]? | web
Initial value auto
Applies to @prince-pdf at-rule
Inherited no
Comments

This property controls whether relative links should be embedded in the PDF as web (URL) links or file links (by default they will be resolved against the base URL of the input document), and whether to open the links in the same or a new window.

Note however that the optional link target keywords same-window and new-window only affect links to local PDF files.

See Also
  • PDF Links
prince-pdf-open-action*
Syntax
prince-pdf-open-action: none | [ print | command( ident ) | zoom( fit-page | fit-width | fit-height | percent ) ]+
Initial value none
Applies to @prince-pdf at-rule
Inherited
Examples
@prince-pdf {
    prince-pdf-open-action: zoom(fit-page) print;
}
Comments

This property specifies a space-separated list of actions to perform when the PDF file is opened, like eg. popping up the print dialog box automatically, or setting the default zoom level for PDF documents. Any arbitrary identifier can be specified, although these may be PDF viewer specific; Acrobat can take just about any menu item.

See Also
  • PDF Actions
prince-pdf-output-intent*
Syntax
prince-pdf-output-intent: auto | url( filename )
Initial value auto
Applies to @prince-pdf at-rule
Inherited
Examples
@prince-pdf {
    prince-pdf-output-intent: url("ISOcoated_v2_eci.icc")
}
Comments

This property is used inside a @prince-pdf at-rule to select the intended output color space of the generated PDF file.

See Also
  • prince-fallback-cmyk-profile
  • Color Management
prince-pdf-page-colorspace*
Syntax
prince-pdf-page-colorspace: auto | none | rgb | cmyk | gray
Initial value auto
Applies to @page at-rule
Inherited no
Examples
@page {
    prince-pdf-page-colorspace: cmyk;
}
Comments

This CSS at-rule descriptor can control the colorspace of pages in the PDF file, which affects blending of transparent content. The keyword auto is currently equivalent of rgb.

See Also
  • Page color space
prince-pdf-page-label*
Syntax
prince-pdf-page-label: auto | content
Initial value auto
Applies to @page at-rule
Inherited
Examples
@page {
    prince-pdf-page-label: counter(page, lower-roman)
}
Comments

This CSS at-rule descriptor can be used to set the page label that will be displayed in the PDF viewer.

Several ways of creating content are here defined by means of functions - the detailed explanation can be found in the Generated Content Functions section.

See Also
  • Generated Content Functions
  • PDF Pages
  • content
prince-pdf-page-layout*
Syntax
prince-pdf-page-layout: auto | single-page | two-page | two-page-left | two-page-right | one-column | two-column | two-column-left | two-column-right
Initial value auto
Applies to @prince-pdf at-rule
Inherited
Examples
@prince-pdf {
    prince-pdf-page-layout: two-column
}
Comments

This property can be used to set the default page layout for the PDF file when it is opened. For example, whether the PDF pages should be displayed in one or two columns.

See Also
  • PDF Pages
prince-pdf-page-mode*
Syntax
prince-pdf-page-mode: auto | show-attachments | show-bookmarks | fullscreen
Initial value auto
Applies to @prince-pdf at-rule
Inherited
Examples
@prince-pdf {
    prince-pdf-page-mode: show-bookmarks
}
Comments

This property can be used to set the default page mode for the PDF file when it is opened. For example, whether the bookmarks panel should be displayed, and whether the viewer should be fullscreen.

See Also
  • PDF Pages
prince-pdf-paper-tray*
Syntax
prince-pdf-paper-tray: auto | pick-tray-by-pdf-size
Initial value auto
Applies to @prince-pdf at-rule
Inherited
Examples
@prince-pdf {
    prince-pdf-paper-tray: pick-tray-by-pdf-size
}
Comments

This property controls the PickTrayByPDFSize flag in generated PDF files, which specifies whether the PDF page size is used to select the input paper tray. (See the checkbox in the Acrobat print dialog).

See Also
  • PDF Printing
prince-pdf-print-scaling*
Syntax
prince-pdf-print-scaling: auto | none
Initial value auto
Applies to @prince-pdf at-rule
Inherited
Examples
@prince-pdf {
    prince-pdf-print-scaling: none
}
Comments

This property can be used to disable print scaling for the PDF file when it is printed.

See Also
  • PDF Printing
prince-pdf-profile*
Syntax
prince-pdf-profile: none | "Profile"
Initial value none
Applies to @prince-pdf at-rule
Inherited
Examples
@prince-pdf {
    prince-pdf-profile: "PDF/X-3:2003"
}
Comments

PDF Profiles are used to optimize the PDF file for its specific use - for more details and the supported PDF profiles, see PDF Versions and Profiles.

See Also
  • PDF Versions and Profiles
prince-pdf-script*
Syntax
prince-pdf-script: "JavaScript" | url
Initial value ""
Applies to @prince-pdf at-rule
Inherited
Examples
@prince-pdf {
    prince-pdf-script: "this.print();"
}
Comments

This property can be used to include JavaScript code that will be executed when the PDF file is opened. A common use case is to activate the "Print" dialog automatically. The script can be located in an external JavaScript file, referenced with the url() function.

Please be advised that these scripts are dependent on the PDF viewer, and in many cases might only work in Adobe Acrobat products.

See Also
  • PDF Actions
prince-pdf-tag-type*
Syntax
prince-pdf-tag-type: auto | Part | Art | Sect | Div | Index | BlockQuote | Caption | TOC | TOCI
Initial value auto
Applies to all elements
Inherited
Examples
ul.toc {
  prince-pdf-tag-type: TOC;
}
.toc li {
  prince-pdf-tag-type: TOCI;
}
Comments

This property is used to influence tagged PDF for XML vocabularies or when using custom HTML classes. The possible values are PDF tag types.

See Also
  • PDF Tags
prince-pdf-xmp*
Syntax
prince-pdf-xmp: url( filename )
Initial value ""
Applies to
Inherited
Examples
@prince-pdf {
    prince-pdf-xmp: url("xmp-file.xmp");
}
Comments

This property can be used inside a @prince-pdf rule to add XMP metadata to a PDF file. Currently it takes an XMP file as input and includes data from the <x:xmpmeta> element and its contents (the xpacket processing instructions are ignored, as Prince generates those itself when it produces the PDF file).

This property requires either a URL pointing to an XMP file, or an encoded data: URL.

prince-rotate-body*
Syntax
prince-rotate-body: portrait | landscape | angle
Initial value 0deg
Applies to @page at-rule
Inherited
Examples
@page {
    prince-rotate-body: landscape
}
Comments

This CSS at-rule descriptor can be used to rotate the page body, eg. to fit landscape content on a portrait page, while leaving the headers and footers where they are.

Please see the size property for determining the default orientation of the page.

See Also
  • Printing wide content sideways
prince-shrink-to-fit*
Syntax
prince-shrink-to-fit: none | auto
Initial value none
Applies to @page at-rule
Inherited
Examples
@page {
	prince-shrink-to-fit: auto
}
Comments

Specifying a value of auto will result in wide web pages being scaled down in size to fit the paper width.

See Also
  • Printing wide content sideways
prince-table-column-span*
Syntax
prince-table-column-span: number | attr( colspan )
Initial value 1
Applies to table cells
Inherited no
Comments

This property applies to table cells and determines the number of table columns spanned by the table cell. See the Tables documentation for more details.

The property table-column-span can be used as an alias.

prince-table-row-span*
Syntax
prince-table-row-span: number | attr( rowspan )
Initial value 1
Applies to table cells
Inherited no
Comments

This property applies to table cells and determines the number of table rows spanned by the table cell. See the Tables documentation for more details.

The property table-row-span can be used as an alias.

prince-text-justify*
Syntax
prince-text-justify: auto | prince-cjk
Initial value auto
Applies to all elements
Inherited yes
Comments

This property defines how to treat justified text. The value prince-cjk allows space to be inserted between CJK characters when justifying even if there aren't any space characters.

See Also
  • Paragraph formatting
prince-text-replace*
Syntax
prince-text-replace: none | [ "search" "replace" ]+
Initial value none
Applies to all elements
Inherited no
Examples
body {
  prince-text-replace: "s" "\017F"
                       "\017F\20" "s\20";
}
Comments

This property can be used to replace a character string with another one. In the above example, all occurrences of "s" are replaced with the "long s", except if in the end of a word, where the replacement is reversed.

See Also
  • Character Entities
prince-text-wrap*
Syntax
prince-text-wrap: body | heading | title | body-lookahead | heading-lookahead | title-lookahead | fast
Initial value body
Applies to all elements
Inherited yes
Comments

This property is used for fine tuning the line breaking approach.

The keyword title is intended for title pages of books or chapters, where phrasing considerations are of prime consideration even at the cost of extremely unbalanced lines.

The keyword heading, on the other hand, is closer to body, differing mainly in that it's less likely to hyphenate, and is more willing to make the first line(s) a little shorter if doing so avoids a short last line.

The *-lookahead keywords enable paragraph-at-a-time line-breaking for the paragraph in a non-justified paragraph: choosing where to end the line not just based on what seems best for the current line, but also considering the effect on future lines.

The keyword fast can be used for quick web-browers–style line breaking, useful for testing the effect of styling changes that don't depend on good line breaking.

For more details, please see Line breaking.

This property only applies to Prince for Books.

The property prince-line-break-choices can be used as an alias.

See Also
  • Line breaking
  • The property prince-line-break-choices
prince-tooltip*
Syntax
prince-tooltip: transparent | none | normal | content
Initial value transparent
Applies to all elements
Inherited no
Examples
*[title] {
  prince-tooltip: attr(title)
}
Comments

The prince-tooltip property can be used to create a tooltip when hovering an element in the PDF file. The keyword none actually "suppresses" tooltips, which means that it will not show any tooltip for objects underneath the selected element, that might have a tooltip. An empty string, or some content that evaluates to an empty string, is treated equivalent to none, rather than showing an empty tooltip.

Several ways of creating content are here defined by means of functions - the detailed explanation can be found in the Generated Content Functions section.

Tooltips are not a standard PDF feature, and they may only work in Adobe Reader and Adobe Acrobat and may not be visible in other PDF viewers, such as web browsers.

See Also
  • Generated Content Functions
  • Generated Content
  • content
prince-trim*
Syntax
prince-trim: auto | [ length ] {1..4}
Initial value auto
Applies to @page at-rule
Inherited
Examples
@page {
	prince-trim: 60mm
}
Comments

This CSS at-rule descriptor can be used to specify the size of the trim area of the page when crop marks are enabled.

See Also
  • Page style
  • prince-bleed
prince-wrap-inside*
Syntax
prince-wrap-inside: auto | phrase | avoid
Initial value auto
Applies to all elements
Inherited no
Comments

prince-wrap-inside:phrase is for marking up a phrase that one would weakly prefer to keep on a single line.

It adds to Prince's perceived cost of breaking within that phrase, but only a small cost, comparable to the cost of hyphenating a compound adjective such as ‘midyear’.

prince-wrap-inside:avoid is a stronger directive: it avoids breaking the text to which the property is applied even if it causes the affected text to be unusually tight, or the previous line to be unusually loose; but not if either line would become truly exceptionally tightly or loosely spaced.

(Limitation: At the time of writing, prince-wrap-inside only affects justified text.)

This property only applies to Prince for Books.

See Also
  • Line breaking
  • The property prince-wrap-inside
  • prince-forced-breaks
  • white-space
right
Syntax
right: auto | length | percent
Initial value auto
Applies to positioned elements
Inherited no
Comments

This property determines the right offset for positioned elements (ie. elements with a position value of relative, absolute or fixed).

Specification
  • CSS 2.1
size
Syntax
size: paper-size | length length [ landscape | portrait ]?
Initial value Letter
Applies to @page at-rule
Inherited
Examples
@page { size: A4 }
@page { size: A4 landscape }
@page { size: Letter }
@page { size: 10cm 5cm }
Comments

This CSS at-rule descriptor, used with the @page at-rule, defines the size and orientation of the page. Please see also the prince-rotate-body property to control the orientation of selected pages.

See Also
  • Page size
  • Page Size Keywords
  • prince-rotate-body
Specification
  • CSS Paged Media Module Level 3
src
Syntax
src: [ url( filename ) [ format( [ "format" ]+ ) ]? | local( name ) | prince-lookup( name ) ]+
Initial value n/a
Applies to @font-face at-rule
Inherited
Examples
@font-face {
    font-family: MyFontA;
    src: local("Local_Font_A");
}
@font-face {
    font-family: MyFontB;
    src: prince-lookup("MyFontA");
}
    
Comments

This CSS at-rule descriptor, used with the @font-face at-rule, specifies the resource containing font data. It is required for the @font-face rule to be valid.

Prince supports WOFF (Web Open Font Format), TrueType and OpenType font formats, expressed respectively by the woff, truetype and opentype format hints with the optional format() function.

The local() function searches for locally installed system fonts, while prince-lookup() will also find fonts defined by other @font-face rules.

See Also
  • Fonts
Specification
  • CSS Fonts Module Level 3
stop-color
Syntax
stop-color: color
Initial value black
Applies to SVG elements
Inherited no
Comments

The stop-color property only applies to SVG elements.

See Also
  • Color
Specification
  • SVG 1.1
stop-opacity
Syntax
stop-opacity: number
Initial value 1
Applies to SVG elements
Inherited yes
Comments

The stop-opacity property only applies to SVG elements.

Specification
  • SVG 1.1
string-set
Syntax
string-set: none | [ ident content ]+
Initial value none
Applies to all elements
Inherited no
Comments

This property can be used to create a named string, which may then be referenced from the content property to create generated content. Typically this is achieved with the content() function, which retrieves the text of the selected element.

But any other means of generating content, as described in the Generated Content Functions section, are available. See also Page regions for more details.

See Also
  • Generated Content Functions
  • content
Specification
  • CSS Generated Content for Paged Media Module
  • CSS Books
stroke
Syntax
stroke: none | color | url( paint-server )
Initial value none
Applies to SVG elements
Inherited yes
Comments

The stroke property only applies to SVG elements.

Specification
  • SVG 1.1
stroke-dasharray
Syntax
stroke-dasharray: none | [ length | percent ]+
Initial value none
Applies to SVG elements
Inherited yes
Comments

The stroke-dasharray property only applies to SVG elements. It takes a comma or whitespace separated list of lengths or percentages as argument.

See Also
  • Data Type List
Specification
  • SVG 1.1
stroke-dashoffset
Syntax
stroke-dashoffset: length | percent
Initial value 0
Applies to SVG elements
Inherited yes
Comments

The stroke-dashoffset property only applies to SVG elements.

Specification
  • SVG 1.1
stroke-linecap
Syntax
stroke-linecap: butt | round | square
Initial value butt
Applies to SVG elements
Inherited yes
Comments

The stroke-linecap property only applies to SVG elements.

Specification
  • SVG 1.1
stroke-linejoin
Syntax
stroke-linejoin: miter | round | bevel
Initial value miter
Applies to SVG elements
Inherited yes
Comments

The stroke-linejoin property only applies to SVG elements.

Specification
  • SVG 1.1
stroke-miterlimit
Syntax
stroke-miterlimit: number
Initial value 4
Applies to SVG elements
Inherited yes
Comments

The stroke-miterlimit property only applies to SVG elements.

Specification
  • SVG 1.1
stroke-opacity
Syntax
stroke-opacity: number
Initial value 1
Applies to SVG elements
Inherited yes
Comments

The stroke-opacity property only applies to SVG elements.

Specification
  • SVG 1.1
stroke-width
Syntax
stroke-width: length | percent
Initial value 1
Applies to SVG elements
Inherited yes
Comments

The stroke-width property only applies to SVG elements.

Specification
  • SVG 1.1
table-baseline
Syntax
table-baseline: number
Initial value 1
Applies to table and inline-table elements
Inherited no
table-column-span*
Syntax
table-column-span: number | attr( colspan )
Initial value 1
Applies to table cells
Inherited no
Comments

This property applies to table cells and determines the number of table columns spanned by the table cell. See the Tables documentation for more details.

The property prince-table-column-span can be used as an alias.

table-layout
Syntax
table-layout: auto | fixed
Initial value auto
Applies to table and inline-table elements
Inherited no
Comments

This property determines whether a table uses automatic table layout or fixed table layout. See the Tables documentation for more details.

Specification
  • CSS 2.1
table-row-span*
Syntax
table-row-span: number | attr( rowspan )
Initial value 1
Applies to table cells
Inherited no
Comments

This property applies to table cells and determines the number of table rows spanned by the table cell. See the Tables documentation for more details.

The property prince-table-row-span can be used as an alias.

tab-size
Syntax
tab-size: number | length
Initial value 8
Applies to block containers
Inherited yes
Comments

This property determines the tab-size for preserved tab characters (U+0009). An integer defines number of spaces in a tab, a length represents the width of a tab.

Specification
  • CSS Text Module Level 3
text-align
Syntax
text-align: left | right | inside | outside | center | justify
Initial value left
Applies to block containers
Inherited yes
Specification
  • CSS 2.1
  • CSS Figures
text-align-last
Syntax
text-align-last: left | right | inside | outside | center | justify
Initial value left
Applies to block containers
Inherited yes
Comments

This property allows the last line of an element to receive its own alignment style.

Specification
  • CSS Text Module Level 3
  • CSS Figures
text-anchor
Syntax
text-anchor: start | middle | end
Initial value start
Applies to SVG elements
Inherited yes
Comments

The text-anchor property only applies to SVG text elements.

Specification
  • SVG 1.1
text-decoration
Syntax
text-decoration: none | [ underline || overline || line-through ]
Initial value none
Applies to all elements
Inherited no
Comments

The text-decoration property is a shorthand for setting the following CSS properties:

  • text-line-through-color
  • text-line-through-style
  • text-overline-color
  • text-overline-style
  • text-underline-color
  • text-underline-style
Specification
  • CSS 2.1
text-indent
Syntax
text-indent: length | percent hanging?
Initial value 0
Applies to block containers
Inherited yes
Comments

This property determines the indentation of the first line of text in the element. If the hanging keyword is added after the length, a hanging indent will be created by applying the indentation to every line of text but the first.

Specification
  • CSS Text Module Level 3
text-line-through
Syntax
text-line-through: color || text-line-through-style
Initial value none
Applies to all elements
Inherited no
Comments

The text-line-through property is a shorthand for setting the following CSS properties:

  • text-line-through-color
  • text-line-through-style
text-line-through-color
Syntax
text-line-through-color: color
Initial value CurrentColor
Applies to all elements
Inherited no
See Also
  • Color
text-line-through-style
Syntax
text-line-through-style: none | solid | dashed | dotted
Initial value none
Applies to all elements
Inherited no
text-overflow
Syntax
text-overflow: clip | ellipsis
Initial value clip
Applies to block container elements
Inherited no
Specification
  • CSS Basic User Interface Module Level 3 (CSS3 UI)
text-overline
Syntax
text-overline: color || text-overline-style
Initial value none
Applies to all elements
Inherited no
Comments

The text-overline property is a shorthand for setting the following CSS properties:

  • text-overline-color
  • text-overline-style
text-overline-color
Syntax
text-overline-color: color
Initial value CurrentColor
Applies to all elements
Inherited no
See Also
  • Color
text-overline-style
Syntax
text-overline-style: none | solid | dashed | dotted
Initial value none
Applies to all elements
Inherited no
text-transform
Syntax
text-transform: none | lowercase | uppercase | capitalize
Initial value none
Applies to all elements
Inherited yes
Specification
  • CSS 2.1
text-underline
Syntax
text-underline: color || text-underline-style
Initial value none
Applies to all elements
Inherited no
Comments

The text-underline property is a shorthand for setting the following CSS properties:

  • text-underline-color
  • text-underline-style
text-underline-color
Syntax
text-underline-color: color
Initial value CurrentColor
Applies to all elements
Inherited no
See Also
  • Color
text-underline-style
Syntax
text-underline-style: none | solid | dashed | dotted
Initial value none
Applies to all elements
Inherited no
top
Syntax
top: auto | length | percent
Initial value auto
Applies to positioned elements
Inherited no
Comments

This property determines the top offset for positioned elements (ie. elements with a position value of relative, absolute or fixed).

Specification
  • CSS 2.1
transform
Syntax
transform: none | [ rotate( angle ) | translate( offset, offset? ) | translatex( offset ) | translatey( offset ) | translate3d( offset, offset, offset ) | scale( number, number? ) | scalex( number ) | scaley( number ) | skewx( angle ) | skewy( angle ) ]+
Initial value none
Applies to transformable elements
Inherited no
Comments

Please note that the function translate3d() is supported if the Z (third) coordinate is zero, thus making it equivalent to the 2D translate().

Also note that this property currently does not affect SVG elements - they need to use their own transform attribute instead (see Transformations).

Specification
  • CSS Transforms Module Level 1
transform-origin
Syntax
transform-origin: [ center | left | right | top | bottom | percent | length ] {1..2}
Initial value 50% 50%
Applies to transformable elements
Inherited no
Comments

If only one term is given, then the second is assumed to be center. In particular, if only a percentage or length is given, then it is assumed to be the horizontal coordinate.

Either one or two coordinates can be given, and if both values are given as keywords, order doesn't matter; but if two coordinates are given and either coordinate is a length or percentage, then the horizontal component must come first: so top 50% is not valid, but top and top center and 50% top are all valid and equivalent.

Specification
  • CSS Transforms Module Level 1
unicode-bidi
Syntax
unicode-bidi: normal | embed | bidi-override
Initial value normal
Applies to all elements
Inherited no
Specification
  • CSS 2.1
unicode-range
Syntax
unicode-range: urange+
Initial value U+0-10FFFF
Applies to @font-face at-rule
Inherited
Examples
@font-face {
    unicode-range: U+0025-00FF;
}
Comments

This CSS at-rule descriptor, used with the @font-face at-rule, defines the set of Unicode codepoints that may be supported by the font face for which it is declared. The descriptor value is a comma-delimited list of Unicode range (<urange>) values. The union of these ranges defines the set of codepoints that serves as a hint for user agents when deciding whether or not to download a font resource needed for the test content of a particular page.

Specification
  • CSS Fonts Module Level 3
vertical-align
Syntax
vertical-align: baseline | sub | super | top | text-top | middle | bottom | text-bottom | length | percent
Initial value baseline
Applies to inline-level and table-cell elements
Inherited no
Specification
  • CSS 2.1
visibility
Syntax
visibility: visible | hidden
Initial value visible
Applies to all elements
Inherited yes
Comments

This property can be used to make the content of an element invisible.

Unlike using display: none, the element will still take up space on the page and its descendants may still have visible content.

Specification
  • CSS 2.1
white-space
Syntax
white-space: normal | pre | pre-wrap | pre-line | nowrap
Initial value normal
Applies to all elements
Inherited yes
Specification
  • CSS 2.1
widows
Syntax
widows: integer | percent
Initial value 1
Applies to block container elements
Inherited yes
Comments

If a paragraph is split over two pages or columns, this property determines the minimum number of lines that must be left at the top of the second page or column.

The percentage value only applies to Prince for Books, and indicates that one widow line is accepted, as long as the line width is at least the given percentage value of the available page width, to avoid the worst case of having a widow line that is only one or two words long. For more details see Fractional Widows.

See Also
  • Widows and orphans
  • Prince for Books
  • Fractional Widows
  • orphans
Specification
  • CSS 2.1
  • CSS Multi-column Layout Module
width
Syntax
width: auto | length | percent | min-content | max-content
Initial value auto
Applies to all elements but non-replaced inline elements, table rows, and row groups
Inherited no
Comments

The values min-content and max-content do not affect auto table layout.

Specification
  • CSS 2.1
  • CSS Intrinsic & Extrinsic Sizing Module Level 3
word-break
Syntax
word-break: normal | keep-all | break-all
Initial value normal
Applies to all elements
Inherited yes
Comments

Prince does not support the value break-word. Use the value break-all or the property overflow-wrap with the value break-word instead.

See Also
  • Paragraph formatting
  • overflow-wrap
Specification
  • CSS Text Module Level 3
word-spacing
Syntax
word-spacing: normal | length | percent
Initial value normal
Applies to all elements
Inherited yes
Specification
  • CSS Text Module Level 3
writing-mode
Syntax
writing-mode: horizontal-tb | vertical-rl
Initial value horizontal-tb
Applies to all elements except table row groups, table column groups, table rows, and table columns
Inherited yes
Specification
  • CSS Writing Modes Level 3
z-index
Syntax
z-index: auto | number
Initial value auto
Applies to positioned elements
Inherited no
Specification
  • CSS 2.1

CSS Selectors

Below are the CSS selectors supported by Prince. For their precise definition please refer to the CSS specification - Prince largely implements Selectors Level 4.

Terminology and Definitions

selector Can refer to a simple selector, compound selector, complex selector, or selector list.
selector list A comma-separate list of selectors.
compound selector A chain of simple selectors that are not separated by a combinator.
simple selector Either a type selector, universal selector, attribute selector, class selector, ID selector, or pseudo-class.
relative selector A shorthand for selectors that represent elements relative to a :scope element.
combinator Punctuation that represents a particular kind of relationship between compound selectors on either side.
An+B This micro-syntax to indicate indexes in a list of sibling elements represents an integer step (A) and offset (B), i.e. it indicates the An+Bth elements in a list. It also takes the keywords odd and even.
expanded element name The tuple of local element name and namespace name.

Logical Combinations

Selector List
E, F, G A comma-separated list of selectors represents all the elements selected by each selector of the list.
The Matches-Any Pseudo-class
E:matches(s1, s2) The matches-any pseudo-class represents an element E that is represented by the list of compound selectors it takes as argument.
The Negation Pseudo-class
E:not(s1, s2) The negation pseudo-class represents an element E that is not represented by the list of compound selectors it takes as argument.
The Relational Pseudo-class
E:has(rs1, rs2) The relational pseudo-class represents an element E, if either of the relative selectors rs1 or rs2, when evaluated with E as the :scope element, match an element.
The Contains Pseudo-class
E:contains(foo) The contains pseudo-class represents an element E containing the text foo.

Elemental Selectors

Type (tag name) selectors
E A type selector representing an element E in the default namespace.
|E A type selector representing an element E in no namespace.
ns|E A type selector representing an element E in the namespace ns.
*|E A type selector representing an element E in any or no namespace.
Universal selectors
* A universal selector representing all elements in the default namespace.
|* A universal selector representing all elements in no namespace.
ns|* A type selector representing all elements in the namespace ns.
*|* A type selector representing all elements.

Attribute Selectors

Case-sensitivity of the attributes and values depends on the document language. To match values case-insensitively, the attribute selector may contain the identifier i before the closing bracket. (Example: [att=val i])

Default namespaces do not apply to attributes. Therefore a namespace ns that has been previously declared should be added before the namespace separator | preceding the attribute name.

Attribute presence and value selectors
[att] An attribute selector representing an element with the att attribute.
[att=val] An attribute selector representing an element with the att attribute with the value val.
[att~=val] An attribute selector representing an element with the att attribute containing the value val.
[att|=val] An attribute selector representing an element with the att attribute equal to or beginning with the value val.
Substring matching attribute selectors
[att^=val] An attribute selector representing an element with the att attribute whose value begins with the prefix val.
[att$=val] An attribute selector representing an element with the att attribute whose value ends with the suffix val.
[att*=val] An attribute selector representing an element with the att attribute whose value contains val.
Class selectors
E.val A class selector representing an element E with a class identifier val.
ID selectors
E#val An ID selector representing an element E with an ID identifier val.

Linguistic Pseudo-classes

The language pseudo-class
E:lang(C) The language pseudo-class represents an element E that is in the language C.

Input Pseudo-classes

The input control states
:enabled The :enabled pseudo-class represents user interface elements that are in the enabled state.
:disabled The :disabled pseudo-class represents user interface elements that are in the disabled state.
:read-write The :read-write pseudo-class matches an element that is user-alterable.
:read-only The :read-only pseudo-class matches an element that is not user-alterable.
The input value state
:checked The :checked pseudo-class represents user interface elements such as radio and checkbox elements that are selected by the user.

Location Pseudo-classes

The link pseudo-classes
E:link The :link pseudo-class applies to links that have not yet been visited.
E:visited The :visited pseudo-class applies to visited links.
The contextual reference element pseudo-class
E:scope The contextual reference element pseudo-class represents an element E being a designated contextual reference element. :scope is supported in conjunction with :has(), meaning that :scope matches the element that :has() is applied to.

Tree-Structural pseudo-classes

The :root pseudo-class
:root The :root pseudo-class represents an element that is the root of the document. In HTML 4 this is always the HTML element.
The :empty pseudo-class
:empty The :empty pseudo-class represents an element that has no children at all.
The child-indexed pseudo-classes
:nth-child(An+B of S) The :nth-child(An+B) pseudo-class represents the An+Bth element that matches the selector list S among its inclusive siblings.
:nth-last-child(An+B of S) The :nth-last-child(An+B) pseudo-class represents the An+Bth element that matches the selector list S among its inclusive siblings, counting backwards from the end.
:first-child The :first-child pseudo-class represents an element that is first among its inclusive siblings.
:last-child The :last-child pseudo-class represents an element that is last among its inclusive siblings.
:only-child The :only-child pseudo-class represents an element that has no siblings.
The typed child-indexed pseudo-classes
:nth-of-type(An+B) The :nth-of-type(An+B) pseudo-class represents the An+Bth element with the same namespace and type among its inclusive siblings.
:nth-last-of-type(An+B) The :nth-last-of-type(An+B) pseudo-class represents the An+Bth element with the same namespace and type among its inclusive siblings, counting backwards from the end.
:first-of-type The :first-of-type pseudo-class represents an element that is the first with a particular namespace and type among its inclusive siblings.
:last-of-type The :last-of-type pseudo-class represents an element that is the first with a particular namespace and type among its inclusive siblings, counting backwards from the end.
:only-of-type The :only-of-type pseudo-class represents an element that has no siblings with the same namespace and type.

Combinators

Descendant combinator
E F An F element descendant of an E element.
E >> F
Child combinator
E > F An F element child of an E element.
Next-sibling combinator
E + F An F element immediately preceded by an E element.
Following-sibling combinator
E ~ F An F element preceded by an E element.

Tree-Abiding Pseudo-element Selectors

Generated content pseudo-elements
::before Represents a styleable child pseudo-element immediately before the originating element's actual content.
::after Represents a styleable child pseudo-element immediately after the originating element's actual content.
List markers
::marker Represents the automatically generated marker box of a list item.

Typographic Pseudo-element Selectors

The ::first-line pseudo-element
::first-line Represents the content of the formatted line of the originating element.
The ::first-letter pseudo-element
::first-letter Represents the first typographic letter unit of the first formatted line of the originating element, if it is not preceded by other content.

Footnote Pseudo-element Selectors

The ::footnote-call pseudo-element
::footnote-call Represents the footnote calls, i.e. the anchors that refer to footnotes.
The ::footnote-marker pseudo-element
::footnote-marker Represents the footnote markers placed in front of the actual footnote text.

Page Selectors

The nth(N) selector
nth(N) Represents the Nth page of the document: @page:nth(42) {...}

CSS Media Queries

Below are all of the media queries supported by Prince. For their precise definition please refer to the Media Queries Level 4 specification.

Media queries test how Prince is configured, rather than how the document is styled. The configuration of Prince often depends on the command-line arguments passed to it.

Media Queries

A Media Query is a method of testing certain aspects of the user agent or device that the document is being displayed in.

The syntax consists of an optional media query modifier, an optional media type, and zero or more media features.

Several media queries can be combined into a comma separated media query list.

Media Query Modifiers

Negating a media query
not An individual media query can be negated by prefixing it with the keyword not.
Hiding a media query from legacy user agents
only Prefixing a media query with the keyword only will have no effect on the media query's result, but will be ignored by legacy user agents.

Media Types

A media type is a category of user-agent devices on which a document may be displayed. A more fine-grained way of targeting a specific device's exclusive aspects might be to use media features instead, or in addition. Prince defaults to the media type print.

However, note that the command-line option --media can be used to set a media type that media queries can test against. This can be convenient if the person running Prince knows in advance whether the PDF will be printed or viewed on the screen, such as might be the case for slideshows, or in case one might prefer the author's idea of what screen means.

Media types
all Matches all devices.
print Matches printers and devices intended to reproduce or produce a printed display.
screen Matches all devices that are not matched by print or speech.
speech Matches screenreaders and other devices that "read out" a page.

Media Features

A media feature is a more fine-grained way of targeting a specific user-agent. Media features use the same syntax as CSS properties. However, there are some differences between the two:

  • Properties provide information about how to present a document; media features describe requirements of the output device.
  • Media features are wrapped in parentheses and combined with the keyword and.
  • A media feature may be given with only its name to evaluate the feature in a boolean context.
  • Media features with "range" type may be expressed with standard mathematical comparison operators.
  • Properties sometimes accept complex values, while media features only accept single values.

Multiple media features may be combined into a media condition using full boolean algebra (not, and, or).

Media feature types
discrete Media features of the type "discrete" take their values from a set.
range Media features of the type "range" take their values from a range. Their feature names can be prefixed by min- or max-.

Dimension Media Features

width
Value: length Describes the width of the displayed page.
Type: range
height
Value: length Describes the height of the displayed page.
Type: range
aspect-ratio
Value: length Describes the ratio of the width to the height of the displayed page.
Type: range
orientation
Value: portrait | landscape Describes the width of the displayed page.
Type: discrete

Display Quality Media Features

resolution
Value: resolution | infinite Describes the resolution of the output device.
Type: range
scan
Value: interlace | progressive Describes the scanning process of the output device. This feature is always false for Prince.
Type: discrete
grid
Value: boolean Describes whether the output device is grid (1) or bitmap (0). Prince is bitmap based, and thus 0 matches.
Type: discrete
update
Value: none | slow | fast Describes the ability of the output device to modify the appearance of the content once it has been rendered. In Prince the layout cannot be updated, and thus only none matches.
Type: discrete
overflow-block
Value: none | scroll | optional-paged | paged Describes the behavior of the device when content overflows the initial containing block in the block axis..
Type: discrete
overflow-inline
Value: none | scroll Describes the behavior of the device when content overflows the initial containing block in the inline axis..
Type: discrete

Color Media Features

color
Value: integer Describes the number of bits per color component of the output device. Prince assumes 13 color bits.
Type: range
color-index
Value: integer Describes the number of entries in the color lookup table of the output device.
Type: range
monochrome
Value: integer Describes the number of bits per pixel in a monochrome framebuffer.
Type: range
color-gamut
Value: srgb | p3 | rec2020 Describes the approximate range of colors that are supported by the output device.
Type: discrete

Interaction Media Features

pointer, any-pointer
Value: none | coarse | fine Describes the presence and accuracy of pointing devices. Prince assumes none.
Type: discrete
hover, any-hover
Value: none | hover Describes the user's ability to hover over elements on the page. Prince assumes none.
Type: discrete

Scripting Media Features

scripting
Value: none | initial-only | enabled Describes whether scripting languages, such as JavaScript, are supported. Prince assumes none or initial-only, depending on its configuration.
Type: discrete

CSS Functional Expressions

In this section you find the documentation for the supported CSS functional expressions. For additional details, make sure to also check the linked properties that use the functions.

* functions marked with an asterisk are Prince extensions.

Function Definition Used in property
attr( attribute-name type-or-unit? [, fallback]? ) Retrieves the value of an attribute of the selected element.
url( url ) Represents a URL, i.e. a pointer to a source.
rgb(R,G,B) Defines red, green and blue values of a color. all color values
rgba(R,G,B,A) Defines red, green and blue values and the alpha component of a color.
cmyk(C,M,Y,K[,A]) | device-cmyk(C,M,Y,K[,A]) Defines cyan, magenta, yellow and black values of a color, as well as the optional alpha component.
hsl(H,S,L) Defines hue, saturation and lightness values of a color.
hsla(H,S,L,A) Defines hue, saturation and lightness values and the alpha component of a color.
prince-color( colorname [, number | percentage]? , overprint? )* Using a spot color defined in the @prince-color at-rule. The number or percentage defines the tint. An optional overprint keyword instructs Prince whether to overprint the color.
color: prince-color(MyColor, 50%, overprint)
prince-overprint( colorname | rgb() | cmyk() | device-cmyk() | hsl() | prince-color() [, [overprint-mode-nonzero | overprint-mode-zero]]? )* Specifies a non-transparent color value to overprint. If no overprint mode is given, it defaults to overprint-mode-nonzero.
linear-gradient([ [ <angle> | to <side-or-corner> ] ,]? <color-stop>[, <color-stop>]+) Creates an image consisting of a progressive transition between two or more colors along a straight line. background-image
radial-gradient([ [ <shape> || <size> ] [ at <position> ]?, | at <position>, ]? <color-stop> [, <color-stop> ]+) Creates an image consisting of a progressive transition between two or more colors that radiate from an origin point
repeating-linear-gradient([ [ <angle> | to <side-or-corner> ] ,]? <color-stop> [, <color-stop>]+) Creates an image consisting of repeating linear gradients.
repeating-radial-gradient([ [ <shape> || <size> ] [ at <position> ]?, | at <position>, ]? <color-stop> [, <color-stop> ]+) Creates an image consisting of repeating radial gradients.
rect( offset, offset, offset, offset ) Defines a region in the form of a rectangle. clip
content() Retrieves the text content of the selected element. It can be used with several different properties. content - see also Generated Content Functions
element( name, page-policy? ) Places an element (which has been removed from the normal flow with the running() function) in a page region. See Taking elements from the document.
counter( name, counter-style?, page-policy? ) Generates a value for the innermost counter.
counters( name, "separator", counter-style?, page-policy? ) Concatenates counters on different levels.
target-counter( url, counter, counter-style? ) Retrieves the value of the innermost counter with a given name at the given URL. See Using target-counter().
target-counters( url, counter, "separator", counter-style? ) Retrieves the value of all counters of a given name from the end of the given URL.
target-content( url ) References the text content of the linked element. See Using target-content().
leader( "..." | dotted | solid | space ) Inserts the given string before the element - useful in tables of content.
string( ident, page-policy? ) Retrieves the value defined with the string-set property. See Copying content from the document.
repeat( string+ ) Used in counters as a counter-style, it defines a sequentially repeated pattern for numbering the items.
h4::before { counter(h4, repeat("x", "y", "z")) }

This counter will yield the sequence "x, y, z, xx, yy, zz" etc.

symbols( string+ ) Used in counters as a counter-style, it defines the symbols used for numbering the items.
h4::before { counter(h4, symbols("x", "y", "z")) }

This counter will yield the sequence "x, y, z, 4, 5, 6" etc.

prince-base-url()* Returns the base URL of the current document.
flow( name, page-policy? ) | prince-flow( name, page-policy? )* Inserts an element that has previously been removed with the static() function. See Taking elements from the document.
prince-script( ident [, content+]? )* Calls arbitrary JavaScript functions in CSS generated content.
prince-fallback( uri )*[, content+]? Inserts content fetched from another resource (like the url() function), but also has the possibility of specifying a fallback content, in case the loading of the URL should fail. If no comma and content items are provided, the fallback is as if content: normal were specified.
img { content: prince-fallback(attr(src, url)), attr(data-altsrc, url) }
prince-glyph-index( int )* Allows to choose a glyph from a font by the index of that glyph in the font.

Please note that this is very non-portable, as glyph indices are specific to individual font versions. But it is a possible escape hatch for people who need a specific glyph and don't have any other way of accessing it (by Unicode character or OpenType substitution).

Usually, authors should prefer to use named OpenType features, using the prince-opentype() value of the font-variant property, which is more likely to work when changing font.

grayscale( number | percent ) Converts the input image to grayscale. filter
sepia( number | percent ) Converts the input image to sepia.
saturate( number | percent ) Saturates the input image.
hue-rotate( angle ) Applies a hue rotation on the input image.
invert( number | percent ) Inverts the samples in the input image.
opacity( number | percent ) Applies transparency to the input image.
brightness( number | percent ) Applies a linear multiplier to the input image, making it appear more or less bright.
contrast( number | percent ) Adjusts the contrast of the input image.
blur( length ) Applies a Gaussian blur to the input image.
drop-shadow( length{1..3}, color? ) Applies a drop shadow effect to the input image.
prince-opentype( [ feature ]+ )* Specifies a comma-separated list of OpenType features to be enabled. For details please see the font-variant property and OpenType Features in Prince. font-variant
running( name ) Removes an element from the normal document flow, to make it available for use in a page region with the element() function. See Taking elements from the document. position
recompress-jpeg( quality% )* Recompresses JPEG images by the indicated percentage to save space. prince-image-magic
convert-to-jpeg( quality% )* Converts non-JPEG images to JPEG.
static( name, [ start | current ]? )* Removes an element from the normal document flow, to make it available for use with the flow() function. See Taking elements from the document. prince-flow
command( ident )* Specifies any arbitrary command to be passed to the PDF viewer when the PDF file is opened. The user can supply values that Prince doesn't know about, but the viewer does. prince-pdf-open-action
format() Contains a comma-separated list of format strings that denote well-known font formats.
@font-face {
  font-family: bodytext;
  src: url(sans-serif-font.ttf) format("opentype");
}
src
local() Searches for locally installed system fonts.
prince-lookup()* Searches for locally installed system fonts, but will also find fonts defined by other @font-face rules. See Defining a font family.
rotate( angle ) Rotates an element around a fixed point on the 2D plane. transform
matrix( number[, number]{5,5} ) Describes a homogeneous 2D transformation matrix.
translate( offset[, offset]? ) Translates an element on the 2D plane.
translatex( offset ) Translates an element horizontally.
translatey( offset ) Translates an element vertically.
translate3d( offset, offset, offset ) Translates an element in 3D space.
scale( number[, number]? ) Scales an element up or down on the 2D plane.
scalex( number ) Scales an element up or down horizontally.
scaley( number ) Scales an element up or down vertically.
skew( angle[, angle]? ) Skews an element on the 2D plane.
skewx( angle ) Skews an element in the horizontal direction.
skewy( angle ) Skews an element in the vertical direction.
supports([ <supports-condition> | <declaration> ]) Interpreted as a @supports condition. @import

CSS At-rules

In this section you find the documentation for the supported CSS at-rules.

Initial At-Rules

The following at-rules have to appear at the beginning of the CSS document, and exactly in this order:

@charset Defines the fallback encoding to use for the stylesheet. Prince supports stylesheets in UTF-8, UTF-16, Latin1 and Windows-1252.
@import [ <url(URL)> | <string> ] supports([ <supports-condition> | <declaration> ])? <media-query-list>? Allows authors to import style rules from other style sheets. The url(URL) or <string> give the URL of the style sheet to be imported, while the optional supports(...) expression and <media-query-list> state the import conditions.
@namespace [Prefix]? [ <url(URL)> | <string> ] Defines a namespace prefix or default namespace to be used in the stylesheet.

Nested At-Rules

After the initial at-rules, the following at-rules can appear also in nested form in the CSS document:

@page [Name] Selectors { Page-declarations }
Modifies margins, orphans, widows and page breaks of a document when printing it. The pages are identified either by a name, or by a page pseudo-class and page declarations can either be style declarations or page region at-rules.
:left Page pseudo-classes
:right
:recto
:verso
:first
:blank
:nth(N)
@left | @left-top | @left-middle | @left-bottom Page region at-rules
@right | @right-top | @right-middle | @right-bottom
@top | @top-left-corner | @top-left | @top-center | @top-right | @top-right-corner
@bottom | @bottom-left-corner | @bottom-left | @bottom-center | @bottom-right | @bottom-right-corner
@page-float-top | @page-float-bottom | @prince-overlay
@footnote
The @page rule takes the following CSS properties: prince-bleed | prince-mark-length | prince-mark-offset | prince-mark-width | prince-pdf-page-colorspace | prince-pdf-page-label | prince-rotate-body | prince-shrink-to-fit | prince-trim | size
@media Media-query-list { Rules }
The rules will apply if the device meets the criteria of the condition defined in the media query. See CSS Media Queries for details.
@supports Condition { Rules }
Checks whether particular property:value combinations are supported. Unlike media queries, this uses the classical two-valued logic.
@font-face { Font-declarations }
Links a font family to an actual font.
The @font-face rule takes the following CSS descriptors:
font-family: <family-name> This descriptor defines the font family name that will be used in all CSS font family name matching. It is required for the @font-face rule to be valid.
src: [ url(<URL>) format(<string>#)? | local(<family-name>) | prince-lookup(<family-name>) ]# This descriptor specifies the resource containing font data. It is required for the @font-face rule to be valid. The local() function searches for locally installed system fonts, but prince-lookup() will also find fonts defined by other @font-face rules.
unicode-range: <urange># This descriptor defines the set of Unicode codepoints that may be supported by the font face. The descriptor value is a comma-delimited list of Unicode range values.
Additionally, @font-face takes the CSS descriptors font-variant, font-stretch, font-weight and font-style, which take the same values as the CSS properties with the same name.
@prince-color Name { alternate-color: ... }
Defines a new color name.
The @prince-color rule takes the mandatory alternate-color property to specify an alternate color to use if the named spot color is not available. The named color is used in a stylesheet with the prince-color() function. (See Spot colors).
@prince-pdf Name { Declarations }
Defines properties relating to PDFs.
The @prince-pdf rule takes the following CSS properties: prince-fallback-cmyk-profile | prince-filter-resolution | prince-pdf-color-conversion | prince-pdf-color-options | prince-pdf-open-action | prince-pdf-output-intent | prince-pdf-page-layout | prince-pdf-page-mode | prince-pdf-paper-tray | prince-pdf-print-scaling | prince-pdf-profile | prince-pdf-script | prince-pdf-xmp

JavaScript Support

Prince supports most of ECMAScript 5th edition, but not strict mode. Later editions of ECMAScript are not supported.

The following table shows supported JavaScript objects, methods and properties. For more details, see also JavaScript in Prince.

* objects, methods and properties marked with an asterisk are Prince extensions.

Toggle (open/close) all properties

Page Size Keywords

Prince supports the following page size keywords.

Keywords are not case sensitive, thus "A4" and "a4" are equivalent.

Keyword Page Size
A0 841mm × 1189mm
A1 594mm × 841mm
A2 420mm × 594mm
A3 297mm × 420mm
A4 210mm × 297mm
A5 148mm × 210mm
A6 105mm × 148mm
A7 74mm × 105mm
A8 52mm × 74mm
A9 37mm × 52mm
A10 26mm × 37mm
B0 1000mm × 1414mm
B1 707mm × 1000mm
B2 500mm × 707mm
B3 353mm × 500mm
B4 250mm × 353mm
B5 176mm × 250mm
B6 125mm × 176mm
B7 88mm × 125mm
B8 62mm × 88mm
B9 44mm × 62mm
B10 31mm × 44mm
C0 917mm × 1297mm
C1 648mm × 917mm
C2 458mm × 648mm
C3 324mm × 458mm
C4 229mm × 324mm
C5 162mm × 229mm
C6 114mm × 162mm
C7 81mm × 114mm
C8 57mm × 81mm
C9 40mm × 57mm
C10 28mm × 40mm
id-1 85.60mm × 53.98mm
id-2 105.0mm × 74.0mm
id-3 125.0mm × 88.0mm
US-Letter 8.5in × 11.0in
US-Legal 8.5in × 14.0in
US-Executive 7.25in × 10.5in
US-Ledger 17.0in × 11.0in
US-Tabloid 11.0in × 17.0in
US-Government 8.0in × 11.0in
US-Statement 5.5in × 8.5in
US-Folio 8.5in × 13.0in
ansi-a 8.5in × 11.0in
ansi-b 11.0in × 17.0in
ansi-c 17.0in × 22.0in
ansi-d 22.0in × 34.0in
ansi-e 34.0in × 44.0in
arch-a 9.0in × 12.0in
arch-b 12.0in × 18.0in
arch-c 18.0in × 24.0in
arch-d 24.0in × 36.0in
arch-e1 30.0in × 42.0in
arch-e 36.0in × 48.0in
imperial-folio 15.0in × 22.0in
imperial-quarto 11.0in × 15.0in
imperial-octavo 7.5in × 11.0in
royal-folio 12.5in × 20.0in
royal-quarto 10.0in × 12.5in
royal-octavo 6.25in × 10.0in
crown-folio 10.0in × 15.0in
crown-quarto 7.5in × 10.0in
crown-octavo 5.0in × 7.5in
foolscap-folio 8.5in × 13.5in
foolscap-quarto 6.75in × 8.5in
foolscap-octavo 4.25in × 6.75in
medium-quarto 9.0in × 11.5in
demy-quarto 8.75in × 11.25in
demy-octavo 5.625in × 8.75in

Character Entities

Character entities are a method of including arbitrary characters in XML documents by referencing their UNICODE number rather than writing them directly. CSS has a similar mechanism to include special characters.

This can be convenient when you wish to include characters such as smart quotes, symbols or mathematical operators that do not exist in the character encoding that you are using for your XML documents (such as ASCII or ISO-8859-1 "Latin-1"), or when you want to insert some of these characters into the final layout by means of CSS.

Here is an example of including smart quotes in an XML document using character entities:

XML

<p>
These are &#x201C;smart quotes&#x201D; to be precise.
</p>

Output

These are “smart quotes” to be precise.

A typical usecase for character entities in CSS is the prince-text-replace property, which replaces a certain character string with another one. In the sample "Reconstructed Essay" (HTML - PDF), the property is used to replace occurrences of "s" with the "long s" to recreate the original printed book.

CSS

body {
  prince-text-replace: "s" "\017F";
}

The tables below are a quick reference for some commonly requested UNICODE characters, expressed in XML and CSS notation; for everything else please consult the UNICODE code charts.

Accented Letters

XML CSS Character Name
&#xC0; \C0 À A grave
&#xC1; \C1 Á A acute
&#xC2; \C2 Â A circumflex
&#xC3; \C3 Ã A tilde
&#xC4; \C4 Ä A dieresis
&#xC5; \C5 Å A ring
&#xC7; \C7 Ç C cedilla
&#xC8; \C8 È E grave
&#xC9; \C9 É E acute
&#xCA; \CA Ê E circumflex
&#xCB; \CB Ë E dieresis
&#xCC; \CC Ì I grave
&#xCD; \CD Í I acute
&#xCE; \CE Î I circumflex
&#xCF; \CF Ï I dieresis
&#xD1; \D1 Ñ N tilde
&#xD2; \D2 Ò O grave
&#xD3; \D3 Ó O acute
&#xD4; \D4 Ô O circumflex
&#xD5; \D5 Õ O tilde
&#xD6; \D6 Ö O dieresis
&#xD8; \D8 Ø O slash
&#xD9; \D9 Ù U grave
&#xDA; \DA Ú U acute
&#xDB; \DB Û U circumflex
&#xDC; \DC Ü U dieresis
&#x0178; \0178 Ÿ Y dieresis
&#xE0; \E0 à a grave
&#xE1; \E1 á a acute
&#xE2; \E2 â a circumflex
&#xE3; \E3 ã a tilde
&#xE4; \E4 ä a dieresis
&#xE5; \E5 å a ring
&#xE7; \E7 ç c cedilla
&#xE8; \E8 è e grave
&#xE9; \E9 é e acute
&#xEA; \EA ê e circumflex
&#xEB; \EB ë e dieresis
&#xEC; \EC ì i grave
&#xED; \ED í i acute
&#xEE; \EE î i circumflex
&#xEF; \EF ï i dieresis
&#x0131; \0131 ı dotless i
&#xF1; \F1 ñ n tilde
&#xF2; \F2 ò o grave
&#xF3; \F3 ó o acute
&#xF4; \F4 ô o circumflex
&#xF5; \F5 õ o tilde
&#xF6; \F6 ö o dieresis
&#xF8; \F8 ø o slash
&#xF9; \F9 ù u grave
&#xFA; \FA ú u acute
&#xFB; \FB û u circumflex
&#xFC; \FC ü u dieresis
&#xFF; \FF ÿ y dieresis

Symbols

XML CSS Character Name
&#x2022; \2022 • bullet
&#xA2; \A2 ¢ cent
&#xA9; \A9 © copyright
&#xA4; \A4 ¤ currency
&#x2020; \2020 † dagger
&#xB0; \B0 ° degree
&#xF7; \F7 ÷ divide
&#x2021; \2021 ‡ double dagger
&#x0192; \0192 ƒ florin
&#x2044; \2044 ⁄ fraction
&#xA1; \A1 ¡ inverted exclamation
&#xBF; \BF ¿ inverted question
&#xB5; \B5 µ micro
&#xB7; \B7 · middle dot
&#xAC; \AC ¬ not
&#xAA; \AA ª ordfeminine
&#xBA; \BA º ordmasculine
&#xB6; \B6 ¶ paragraph
&#x2030; \2030 ‰ perthousand
&#xB1; \B1 ± plusminus
&#xAE; \AE ® registered
&#xA7; \A7 § section
&#xA3; \A3 £ sterling
&#x2122; \2122 ™ trademark
&#xA5; \A5 ¥ yen

Quotes

XML CSS Character Name
&#x2018; \2018 ‘ left single quote
&#x2019; \2019 ’ right single quote
&#x201C; \201C “ left double quote
&#x201D; \201D ” right double quote
&#x2039; \2039 ‹ left single guillemet
&#x203A; \203A › right single guillemet
&#xAB; \AB « left double guillemet
&#xBB; \BB » right double guillemet
&#x201A; \201A ‚ base single quote
&#x201E; \201E „ base double quote

Accents

XML CSS Character Name
&#xB4; \xB4 ´ acute
&#x02D8; \x02D8 ˘ breve
&#x02C7; \x02C7 ˇ caron
&#xB8; \xB8 ¸ cedilla
&#x5E; \x5E ^ circumflex
&#xA8; \xA8 ¨ dieresis
&#x02D9; \x02D9 ˙ dot accent
&#x02DD; \x02DD ˝ double acute
&#xAF; \xAF ¯ macron
&#x02DB; \x02DB ˛ ogonek
&#x02DA; \x02DA ˚ ring
&#x02DC; \x02DC ˜ tilde

Special Space Characters

XML CSS Character Name
&#x20; \x20 foo bar space
&#xa0; \xa0 foo bar no-break space
&#x2008; \x2008 foo bar punctuation space
&#x2009; \x2009 foo bar thin space
&#x200a; \x200a foo bar hair space
&#x200b; \x200b foo​bar zero width space
&#x202f; \x202f foo bar narrow no-break space
&#x205f; \x205f foo bar medium mathematical space
&#xfeff; \xfeff foobar zero width no-break space
&#x1680; \x1680 foo bar ogham space mark
&#x2000; \x2000 foo bar en quad
&#x2001; \x2001 foo bar em quad
&#x2002; \x2002 foo bar en space
&#x2003; \x2003 foo bar em space
&#x3000; \x3000 foo bar ideographic space

Miscellaneous

XML CSS Character Name
&#x2026; \x2026 … ellipsis
&#x2014; \x2014 — em dash
&#x2013; \x2013 – en dash
&#xFB01; \xFB01 fi fi ligature
&#xFB02; \xFB02 fl fl ligature
&#xC6; \xC6 Æ AE
&#xE6; \xE6 æ ae
&#x0152; \x0152 Œ OE
&#x0153; \x0153 œ oe
&#xDF; \xDF ß sharp s

Acknowledgments

Prince uses the following open source projects:

Boehm GC
The Boehm GC library is used by the Mercury runtime for garbage collection.
Cairo and Pixman
The Cairo and Pixman libraries are used by Prince for rasterization.
CTAN hyphenation files
Prince uses the hyphenation pattern files from the CTAN archive.
datrie
The datrie library is used by Prince to load the Thai dictionary.
Fontconfig
The Fontconfig library is used by Prince on Linux to scan for installed system fonts.
FreeType
The FreeType library is used by Prince to load and process TrueType font files.
GIFLIB
The GIFLIB library is used by Prince to load GIF image files.
libjpeg-turbo
The libjpeg-turbo library is used by Prince to load JPEG image files.
libcurl
The libcurl library is used by Prince to load resources from HTTP URLs.
GNU libgomp
The GNU libgomp library is used by Prince for OpenMP support.
libpng
The libpng library is used by Prince to load PNG image files.
libthai
The libthai library is used by Prince to handle word breaking in the Thai language.
libtiff
The libtiff library is used by Prince to load TIFF image files.
libxml2
The libxml2 library is used by Prince to load XML and HTML documents.
Little CMS
Little CMS (lcms2) library is used by Prince for color management.
Mercury
Prince is written in the Mercury programming language.
OpenSSL and NSS
The OpenSSL and NSS libraries are used by Prince to load resources from secure HTTPS URLs.
zlib
The zlib library is used by Prince to perform compression of PDF files.
Copyright © 2002 – 2019 YesLogic Pty. Ltd.
  • About Us
  • Privacy Policy
  • Contact Us