Skip to main content
No setup or integration needed — call ZitePdf.renderHtml from a backend workflow and you get back a permanent hosted URL to store, email, or return to the frontend.

Worked example — an invoice

renderHtml returns { url, filename }url is a permanent, public HTTPS download link.

HTML authoring rules

  • One self-contained document<!doctype html>, a <head>, one <style> block. Avoid external <link>s (CSS / font CDNs); they time out in headless Chromium.
  • Set page size and margins at the top of the stylesheet: @page { size: letter; margin: 0.75in; } (size: a4 only for metric paper).
  • Escape user input and coerce numbers (Number.isFinite(...) ? … : 0) before .toFixed().
  • Variable-length sectionsarray.map(...) returning row HTML strings, .join('') into the table body.
  • font-variant-numeric: tabular-nums on tables of numbers so columns align.

Constraints

  • Max output 25 MB — paginate with @page or split large reports.
  • No JS execution in the rendered HTML — keep everything static.
  • No private-network URLs (RFC1918 / file:// / metadata IPs) — the renderer refuses them.
To “fill out a PDF,” reproduce its layout in HTML and substitute values — there’s no AcroForm-fill path.