Skip to content

HTML & SVG Rendering

phpdftk ships a full HTML/CSS rendering engine targeting browser print-stylesheet parity, plus an SVG-to-PDF translator. Both consume a shared CSS + text-shaping substrate.

This section documents:

Phase 1 of the rendering roadmap is in development. See the roadmap for the current sub-phase status.

  • CSS 2.1 visual formatting (block-and-inline, tables, lists)
  • CSS Paged Media 3 (@page, page boxes, named pages, margin boxes)
  • CSS Fragmentation 4 (break-before/after/inside, orphans/widows)
  • CSS Multi-column Layout 1
  • CSS Flexible Box Layout 1
  • CSS Grid Layout 2
  • CSS Transforms 2 (2D; 3D flattened to 2D)
  • Filter Effects 1 (raster filters)
  • CSS Custom Properties for Cascading Variables 1
  • CSS Writing Modes 4
  • Full Declarative Shadow DOM (slot distribution, :host/::slotted/::part/::theme)
  • JavaScript execution. <script> is parsed but never run. Event handlers (onclick, etc.) are dropped. The Custom Elements registry, MutationObserver/IntersectionObserver and similar runtime APIs are not implemented at any phase. Use headless Chromium (Puppeteer, Playwright) if you need scripted rendering.
  • Imperative Element.attachShadow() from author script (declarative <template shadowrootmode> is supported).
  • Interactive features (forms, links to JavaScript, animations).