Rendering
Forme
Render without a browser, within a subset of HTML and CSS.
Set "engine": "forme".
Forme lays the document out without a browser, which makes it the faster engine.
A document outside its subset is refused with 422 unsupported_document, and unsupported lists what was not supported. A few features are left out without a refusal; see Not rendered and not detected.
Supported
| Area | Support |
|---|---|
| Text | Text elements, headings, lists, links. |
| Tables | colspan, rowspan. <thead> repeats on every page; <tfoot> prints on the last page only. A row that does not fit on the page continues on the next one. break-inside: avoid on a <tr> keeps it whole; a row kept whole that is taller than a page is refused. |
| Flexbox | Supported, without flex-wrap and flex-basis. |
| Grid | Numeric tracks and line placement. No named areas or lines, no auto-fill or auto-fit. |
| Positioning | position: relative and absolute. |
| Box model | Margins, padding. Solid, dashed and dotted borders through border and border-top/-right/-bottom/-left; border-radius. |
| Backgrounds | Solid background colors. |
| Pages | @page size and margins. Margin boxes such as @top-center, with counter(page) and counter(pages). |
| Breaks | break-before, break-after, break-inside, orphans, widows. |
| Media | @media print. |
Refused
These are refused with 422 unsupported_document. Examples:
position: fixed. Forme would print the element once, on the page where it occurs, not on every page. Use@pagemargin boxes; see Page setup.::beforeand::after.- The
+and~combinators;:link. - Custom properties,
var()and the:rootselector. - Gradients, background images.
transform,box-shadow,opacity,z-index.- The
border-{side}-widthandborder-{side}-colorlonghands. Use theborder-{side}shorthand, such asborder-bottom: 1px solid #000. white-space.- The
fontandlist-styleshorthands. Use longhand properties such asfont-familyandfont-size. display: gridwithoutgrid-template-columns.@supports;@mediafeatures other than width and orientation, andnot.- Any character no available font covers; see Fonts.
- Arabic-Indic and Persian digits (٠-٩, ۰-۹): Forme draws them in reverse order. Use Western digits (0-9), or render with Chromium.
Not rendered and not detected
The PDF is produced without these:
- Inline
<svg>. - SVG, GIF and AVIF images: a gray box is drawn in their place.
background,paddingandborderon inline elements such as<span>.calc()and thevw,vh,chandexunits. A width set with them makes the element take the full width.- An
<img>inside a line of text is placed on its own line.
Ignored
These have no effect on a printed page and are ignored without a refusal:
- Cursors, transitions, animations and
@keyframes,pointer-events,user-select, scroll and touch behavior, font smoothing,print-color-adjust,color-scheme,appearance. - The
:hover,:focus,:focus-visible,:focus-within,:active,:visitedand:targetstates.
Images and fonts
- Images: PNG, JPEG and WebP, as
data:URIs or fetched from a URL. - Fonts: TrueType only, registered with
@font-face. See Fonts.
Options and limits
scaleis refused with 400option_not_supported_by_engine.taggedworks as with Chromium: a tagged PDF by default,falsefor a smaller untagged file.- A document too large, too deeply nested or too slow for Forme is refused with 422
engine_limit_exceededorrender_deadline_exceeded; see Error codes.
When Forme refuses a document you cannot change, switch engine to chromium.