Length & Angle Units
Prince supports the following length and angle units:
Absolute Length Units
The absolute length units correspond to exact distances in the PDF file.
| Absolute length units | |
|---|---|
| centimeters |
| millimeters |
| quarter-millimeters |
| inches |
| picas |
| points |
Font Length Units
The font length units are relative to the font-size property.
| Font length units | |
|---|---|
| font size of the element |
| font size of the root element |
| x-height in the current font |
| x-height in the font of the root element |
| Line height units | |
| line height of the element |
| line height of the root element |
| Character units | |
| width of the "0" (zero) glyph in the current font |
| width of the "0" (zero) glyph in the font of the root element |
| CapHeight units | |
| nominal height of capital letters in the current font |
| nominal height of capital letters in the font of the root element |
| Ideographic units | |
| width of the "水" glyph (CJK water ideograph, U+6C34) in the current font |
| of the "水" glyph (CJK water ideograph, U+6C34) in the font of the root element |
Viewport Length Units
The viewport length units are relative to the @page area: the unit vw is equal to 1% of the width of the page area, i.e. the page size minus the margin area (and minus border and padding), while the unit vh is equal to 1% of its height.
The values pvw and pvh are equal to respectively 1% of the width and height of the entire page, as defined by the page size.
Please note that these values cannot be used with elements for which a viewport, such as the root element, has not been established.
| Viewport length Units | |
|---|---|
| content area width |
| content area height |
| the smaller length of vw or vh |
| the larger length of vw or vh |
| page width |
| page height |
| the smaller length of pvw or pvh |
| the larger length of pvw or pvh |
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 | |
|---|---|
| pixel |
This can be changed with the command-line option --css-dpi.
Fractional Length Unit
CSS grids require a flexible length, expressed as a fraction of the leftover space in a grid container.
| Fractional length unit | |
|---|---|
| fraction of the leftover space in the grid container |
Angle Units
Furthermore, Prince supports the four angle units deg, grad, rad and turn on the following properties:
- the CSS
transformproperty hasrotate,skewandskewx/skewyoperators; - linear gradients have an angle;
- HSL colors have a hue angle;
- the
hue-rotatefilter takes an angle; - the
@page-prince-rotate-bodydescriptor takes multiples of90deg.