Help Center/Formats

Render HTML, CSS, and web pages to PDF

The HTML command gives agents a stable handoff from a browser page to a PDF file. It accepts local content and URLs, then waits for the page before capture.

Render a local HTML file

Point Jetformat at a file and choose the output path. The command uses the HTML renderer configured for your environment.

CLI
jetformat html to-pdf report.html -o report.pdf --server 127.0.0.1:8080

Render a directory or URL

Use a directory when the page has local CSS, images, fonts, or other assets. Use an HTTPS URL when the source page is already deployed.

CLI
jetformat html to-pdf ./report-site -o report.pdf
jetformat html to-pdf https://example.com/report -o report.pdf

Wait for JavaScript

For dashboards and charts, wait for a selector to become available or visible. You can also add a fixed delay for pages that need a short settling period.

CLI
jetformat html to-pdf dashboard.html -o dashboard.pdf \
  --wait-ready ".dashboard-ready" \
  --wait-visible "svg.chart" \
  --wait 2s

Page size and renderer address

Use standard page sizes such as A4 or Letter, and add --landscape for wide reports. Set JETFORMAT_HTML_SERVER once in the environment instead of repeating --server on every command.

CLI
export JETFORMAT_HTML_SERVER=127.0.0.1:8080
jetformat html to-pdf report.html -o report.pdf --page-size A4 --landscape

When the renderer is not reachable

If the command reports a connection error, confirm that the Jetformat HTML renderer is running and that the address is reachable from the same machine as the CLI. Office conversion, PDF inspection, and PDF rendering do not use this endpoint and continue to work without it.

  • Check the address with JETFORMAT_HTML_SERVER or the --server flag.
  • Keep local CSS, images, and fonts inside the directory passed to the command.
  • For a deployed page, confirm the URL is reachable without an interactive login.

What the HTML command does not do

  • It does not rewrite HTML into Office XML.
  • It does not OCR a screenshot or turn a PDF back into HTML.
  • It needs a reachable Jetformat HTML renderer endpoint; Office and PDF commands do not.