Stolid PDF: HTML to PDF API

Turn HTML into a PDF, with a render report your code can read.

Generate invoices, statements and reports from the HTML you already have. Each successful render returns the PDF and stable warning codes for detected font, asset, script and overflow issues.

POST https://api.stolid.dev/v1/pdf

Free public preview, with keys by email. Try one template with sample data and attach the files it needs. Up to 20 pages, 30 seconds and a 6 MB request; remote file loading is off.

01 / One call

A request goes in. A PDF and a render report come out.

The JSON for a successful render includes pdf_url and manifest.warnings. If POST /v1/pdf answers 202, the render is still running: poll GET /v1/renders/{render_id} until it finishes. If you ask for the PDF file itself with ?response=binary, use that same GET to read the full report.

1 · RequestPOST /v1/pdf
curl https://api.stolid.dev/v1/pdf \
  -H "Authorization: Bearer stolid_live_…" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Invoice 0042</h1> …"}'

2 · The PDF · illustration with sample data

3 · Render reportmanifest
"manifest": {
  "warnings": [
    {
      "code": "FONT_FALLBACK",
      "message": "…"
    },
    {
      "code": "REQUEST_BLOCKED",
      "message": "…"
    },
    {
      "code": "CONTENT_OVERFLOW",
      "message": "…"
    }
  ]
}

02 / Warning codes

Useful feedback, even when the PDF succeeds.

Each warning has a stable code and a message. Read FONT_FALLBACK to find substituted fonts, ASSET_FAILED to find missing files and CONTENT_OVERFLOW to find content that runs past the page. Your application decides which warnings need a fix or a review. Codes keep their meaning; new codes may be added over time.

Warning codes, what they mean and what to do
CodeWhat it meansWhat to do
FONT_FALLBACKA font you asked for is not available; a similar one was used.Send the font file with the request, or choose an available font.
FONT_FACE_FAILEDA font file you declared with @font-face could not be used.Check the font file and its name in assets.
ASSET_FAILEDA file was missing from assets or failed to load.Add the file, or correct its name in the HTML.
REQUEST_BLOCKEDA file request was blocked.Send remote files in assets.
CONTENT_OVERFLOWContent extends past the page width or a clipping container.Let the content wrap, or reduce its width.
SCRIPT_ERRORA script in your page raised an error.Fix the script, or remove it from the document.
The report lists detected issues. An empty list does not guarantee a correct layout, and some print CSS differences produce no warning. Check the PDF as well.Warning-code referencePrint CSS notes

03 / What fits

Made for short documents from your own HTML.

One call renders one document. A render counts when it succeeds, including a render with warnings. A failed render does not count.

Pages

20

Pages per document, at most.

Time

30 s

Render time per call, at most.

Request

6 MB

Total request size, including attached files.

Files

Attached

Send CSS, images and fonts in assets. Remote file loading is off during the preview.

Stolid PDF suits invoices, statements and reports generated from HTML and attached files. If you need to capture a live web page, produce documents longer than 20 pages or rely on specialised print CSS, read Files and fonts and Page options before you start.

04 / Clients

Python and Node clients.

A few lines to render a document and read its warnings. Both clients wait for running renders, retry temporary errors and encode your files for you. The package files come with your preview key email; publication on PyPI and npm is Coming soon. Client guide

Pythonstolid-client · PyPI coming soon
from stolid_client import StolidClient

client = StolidClient()  # reads STOLID_API_KEY
html = "<h1>Invoice 0042</h1>"
render = client.create_pdf(html)

for warning in render.warnings:
    print(warning.code, warning.message)
Node@stolidhq/client · npm coming soon
import { StolidClient, getWarnings } from '@stolidhq/client';

const client = new StolidClient(); // reads STOLID_API_KEY
const html = '<h1>Invoice 0042</h1>';
const render = await client.createPdf(html);

for (const w of getWarnings(render)) console.warn(w.code, w.message);

05 / For agents

Agents can use Stolid PDF over HTTP today.

An agent submits HTML, reads the warning codes and revises the document to fix detected issues, inside a retry limit your application sets. Validate the resulting PDF independently: the report does not check every layout issue or the accuracy of the document's contents.

Guide

A bounded fix-and-retry loop

A worked example with a retry limit, a stopping rule and a final check. PDF generation for AI agents

Contract

OpenAPI and Markdown docs

The complete API description in openapi.json, and every page of this site as Markdown through llms.txt.

Safety

Codes first, messages second

Warning messages can quote document text. Have the agent choose a fix from the stable code and treat the message as untrusted input.

06 / For agents · Coming soon

Page images for agents — coming soon.

Optional page images will let an agent look at the rendered pages next to the report. Images and warning codes are different signals; your workflow still decides whether a document is ready.

Optional Coming soon

Ask for images when you need them

Page images will come back with the response, next to the PDF and the report.

Counting Coming soon

Planned to count as one call

The plan is for a call with page images to count the same as a call without.

MCP Coming soon

A hosted MCP server

The Stolid PDF tool will use the same keys as the HTTP API. MCP server status

07 / Questions

Questions developers ask first.

Does an empty warning list mean the PDF is correct?

No. An empty list means no warnings were reported. The report covers the issues Stolid detects, such as missing fonts, blocked requests and overflowing content, and some print CSS differences produce no warning. Check the PDF as well.

Can an AI agent use Stolid PDF today?

Yes, through the HTTP API. An agent can submit HTML, read the stable warning codes and revise the document to fix detected issues. Set a retry limit and validate the result in your own workflow. The hosted MCP server and page images are coming soon.

Can Stolid PDF load images and fonts from a URL?

Not during the public preview: remote file loading is off. Send your CSS, images, fonts and scripts with the request in assets and refer to them by name in your HTML. A request for a remote file is reported as REQUEST_BLOCKED. Several font families, including Inter, Roboto and Noto, are available by name with no upload.

Which documents are a good fit?

Short documents you generate from your own HTML: invoices, statements, receipts and reports of up to 20 pages that render within 30 seconds, in a request of up to 6 MB including attached files. Stolid PDF renders with Chromium, so test any print CSS your templates depend on.

How do I get the Python or Node client?

The package files come with your preview key email, with install steps in the client guide. Publication on PyPI as stolid-client and on npm as @stolidhq/client is coming soon. You can also call the API with plain HTTP from any language.