By Jetformat
HTML-to-PDF rendering is the process of capturing a web document into paginated PDF output. Jetformat’s html to-pdf command accepts a local file, a directory, or a URL and sends the job to a separate Jetformat HTML renderer. It does not use the local Office conversion engine.
Choose a file, directory, or URL
| Source | Use it when | Check before running |
|---|---|---|
| HTML file | The document is self-contained | All required content is present |
| Directory | The page depends on nearby assets | CSS, fonts, and images are included |
| URL | The report is already deployed | The renderer can access the page and resources |
Render and verify a report
- Confirm the renderer address is reachable from the CLI machine.
- Choose the source shape above and an explicit output filename.
- For dynamic content, choose a selector that appears only after the report data is ready.
- Run the conversion and stop if the command fails.
- Read the output with
jetformat pdf info report.pdf, then review representative pages for missing content and page breaks.
to-pdf
jetformat html to-pdf page.html -o page.pdf
jetformat html to-pdf ./site -o site.pdf --page-size A4 --landscape
jetformat html to-pdf https://example.com/report -o report.pdf --wait-ready ".report-ready"
| Flag | Meaning |
|---|---|
-o, --output |
Output path. Required for URL input. |
--page-size |
A4, Letter, and other ISO sizes. |
--landscape |
Rotate the page. |
--wait-ready SELECTOR |
Wait until the selector exists. Repeatable. |
--wait-visible SELECTOR |
Wait until the selector is visible. Repeatable. |
--wait DURATION |
Fixed delay before capture, for example 2s. |
--timeout DURATION |
Give up after this long. |
--server HOST:PORT |
Renderer address. Defaults to JETFORMAT_HTML_SERVER or 127.0.0.1:8080. |
--force |
Overwrite an existing output file. |
The renderer service
html to-pdf sends the page to a separate Jetformat HTML renderer. Office and PDF commands do not use it. If the connection fails, the command exits non-zero and nothing is charged. See the help article.
Readiness versus a fixed wait
A fixed --wait 2s adds a 2-second delay; it does not prove that a network request or chart has completed. A selector gives the page a specific condition to satisfy. --wait-ready checks existence, whereas --wait-visible checks visibility. Pick a marker owned by the report, rather than a navigation element that appears before data loads.
Use --timeout 30s as an illustrative 30-second limit when testing a page. These durations are user-chosen examples, not service performance guarantees. If a job times out, inspect the page condition and resource access before simply raising the limit.
Pagination and credit units
Credits follow output pages. A report producing 6 pages uses 6 conversion credits; rendering 2 preview pages afterwards uses another 2 credits. Those are arithmetic examples. Source HTML length and viewport screenshots do not establish the final PDF page count.
A browser page and a printed page can use different CSS. MDN’s printing guide explains print styles and page rules. Review your own output before relying on a print stylesheet.
Network boundary and limitations
Treat the renderer as a separate processing boundary. A remote renderer must be appropriate for the document and its assets; configuring an address does not make it local. URL input can also cause requests to the source site and its dependencies. Office and ordinary PDF processing do not use this HTML endpoint. For task-level troubleshooting, see HTML rendering setup and readiness checks.