February 2025
This release includes three important breaking changes:
The default value of box-decoration-break
has changed from clone
to slice
to match the CSS specifications and web browsers. This means that blocks will not repeat their top and bottom borders across page breaks by default.
The Prince box-breaking behavior predates the introduction of the box-decoration-break
CSS property, defaulting to repeating borders when breaking a box, so that each fragment had a top and bottom border. When the property was introduced, Prince kept the default value as clone
.
Starting with Prince 16, the default value is changing to slice
to reflect browser behavior and CSS specifications. To retain the old behavior, it must now be specified explicitly with a CSS rule.
Before Prince 16, lists were indented by a non-zero margin on ol
and ul
elements. However, browsers indent lists by applying a non-zero padding.
Starting with Prince 16, Prince now follows the browser behavior for consistency. This may affect documents previously designed for Prince with this inconsistency in mind.
Before Prince 16, the @page:first
and @page:nth()
selectors, when used together with the CSS property -prince-page-group: start
in a page group, would select the first, or the nth page of the page group, respectively.
Starting with Prince 16, these selectors always select the first and nth page of the whole document. To select the first or nth page of a page group, use the selectors @page:first-of-group
and @page:nth-of-group()
.
Breaking changes would ideally be avoided, but if we can't avoid them forever, then we'd rather make them sooner rather than later to reduce the overall impact. Apologies for any inconvenience this may cause.
Support for CSS grid layout (single page only, no fragmentation).
Support for the CSS :is()
selector, formerly called :matches()
.
Support for the CSS :where()
selector.
Support for the CSS :any-link
selector.
Added a new @page :first-of-group
and :nth-of-group()
selectors and changed :first
and :nth()
to always be based on the absolute page number, not the page group.
Support for css-color-4 syntax for rgb()/rgba(), hsl()/hsla(), and hwb() color function, except for 'none' components.
Support for css-color-4 style syntax for device-cmyk() and cmyk().
Support for the row-gap and column-gap properties on flex containers.
Support for the gap shorthand property on flex containers.
Support for more values for the align-content, justify-content, align-items, and align-self flex properties and support for the place-content shorthand property.
Support for the accent-color property on PDF radio and checkbox form controls.
Added a new CSS property -prince-pdf-form-field-font-size: normal | auto
(defaulting to normal) that allows text inputs in PDF forms to automatically size the text to fit the available space.
Support for the "inset" CSS shorthand property.
Support for text-underline-offset and text-decoration-thickness properties, and the "from-font" value for the text-underline-position property.
Support for prince-pdf-tag-title: none | <string> | attr()
.
Added a new CSS property prince-pdf-role-map that can be used in the @prince-pdf rule to support custom PDF tags such as "H7" by mapping them to standard tags like Div and P.
Added a new @prince-pdf property "prince-pdf-tagged: auto | enable".
Support for the new CSS syntax for alternate text on the content property.
Support for the CSS counter-set property.
Support for the CSS "outline" properties.
Support for the CSS "round" function.
Support for the CSS "mod" and "rem" functions.
Support for the CSS "min", "max", and "clamp" functions.
Added support for mixing percent and dimensions within calc() functions for some popular CSS properties (width, height, etc.).
Changed the default HTML style sheet to apply padding instead of margin to list elements, to match browser behaviour.
Changed the default value for the "box-decoration-break" property to "slice" to match web browsers and the CSS specification.
Support for JavaScript generator functions.
Support for JavaScript object and array destructuring syntax.
Support for JavaScript spread syntax.
Support for JavaScript rest parameters.
Support for JavaScript default function parameters.
Support for JavaScript template literals and String.raw
.
Support for JavaScript accessor property syntax for getter/setter functions.
Support for shorthand and computed property names in JavaScript object initialisers.
Support for the __proto__
property for setting the prototype in JavaScript object initialisers.
Support for the JavaScript String methods startsWith
, endsWith
, includes
, and repeat
.
Support for the JavaScript DOM parentElement
property.
Support for the JavaScript DOM readyState
property and readystatechange
event.
Support for the JavaScript DOM element closest
method.
Support for more JavaScript DOM child node methods: before
, after
, append
, remove
, replaceWith
.
Added the window.frames
DOM property as some scripts rely on it.
Implemented the JavaScript Object.isExtensible
, isFrozen
, isSealed
, freeze
, preventExtensions
, and seal
methods.
Support for the JavaScript Object.assign
and Object.is
methods.
Support for the stack
property on JavaScript Error objects that are thrown as exceptions.
Support for OpenType variable fonts.
Support for OpenType fonts with CFF2 outlines, such as the Adobe Source fonts.
Support for the Myanmar (Burmese) script.
Support for the TrueType "kern" table for kerning when the OpenType GPOS table is not present.
Support for ligature substitutions in OpenType fonts that use the Apple "morx" table.
Improved subsetting of OTF fonts (OpenType with CFF outlines).
Support for text-transform case conversion rules for the Turkish, Lithuanian, and Azeri languages.
Support for special casing for Greek letter final sigma.
De-duplicate font files embedded multiple times from the same URL.
Added new option --no-rename-duplicate-fonts
which disables renaming fonts with the same name (normally done to avoid a warning from Adobe Preflight).
Added a new --font-specimen
option for creating a sample PDF for the specified font.
Support for the HTML <bdi> element, the "auto" value for the dir attribute, and the CSS :dir() pseudo-class.
Support for unicode-bidi: isolate | isolate-override | plaintext
.
Support for bracket pairing from the revised Unicode bidi algorithm.
Support for explicit directional formatting characters from the revised Unicode bidi algorithm.
Added new --job
command-line option for specifying jobs in JSON format.
Added new --http-header
option for specifying custom HTTP headers.
Support for <input type="prince-pdf-signature"> to create signature fields in PDF forms.
Added new command-line options to specify the attachment file relationship type.
Added new "mime-type" field to the job JSON for describing file attachments.
Added mime-types.txt mapping file for autodetecting attachment MIME type based on file extension.
Use the attachment filename in the PDF name tree for compatibility with Factur-X and other PDF generators.
Adjusted embedded file attachments to pass Factur-X validator.
Allowed the --pdf-script
option to be specified multiple times and the pdf-script JSON job description field to take an array of multiple values.
Allowed prince-pdf-tag-type to specify L for lists, Lbl for list item markers, and LBody for list item bodies (OL/UL are kept as aliases for L but deprecated).
Implemented special behaviour for the list-item counter to mimic the expected behaviour of ordered lists in HTML: when an element creates a list-item counter with "counter-reset: list-item", the scope of the new counter only extends to the element and its descendants, and does not include its following siblings.
Added support for new "cmyk-grayscale" value on prince-pdf-color-conversion property and @prince-pdf descriptor.
Fixed incorrect sizing of blocks containing a sequence of floats.
Fixed issue where the position of the content top for block containers doesn't take borders and padding into account.
Fixed an issue affecting layout of tables with a specified height.
Fixed issues with automatic semicolon insertion in JavaScript.
Sped up the JavaScript DOM getComputedStyle() property when the document has not changed since the last call.
Ensured that spaces between words in justified text are still exposed in the JavaScript box tracking API.
Fixed issue where long sidenotes can cause Prince to hang.
Fixed issue where large Roman numerals can use all available memory.
Report page numbers containing potentially incorrect cross-references.
Added a new fail-safe option --fail-incorrect-references.
Allowed fallback to color emoji when no text presentation emoji glyph is available.
Fixed inconsistency in emoji rendering between PDF and image output.
Improved the creation of link structure elements.
Combined content items where possible in tagged PDF.
Improved handling of floated table captions in tagged PDF structure trees.
Avoided negative stroke dash-phase values as Chrome PDF viewer does not like them.
Added support for links to table row group elements such as HTML tbody.
Use a different User-Agent header for requests to Google Fonts.
See the release history for earlier versions of Prince.