HTML to PDF API
Render a public web page, or HTML you send, to PDF. Takes no input file, so it is the first step of a job with no inputs.
POST /v1/pdf/html-to-pdf
Price: 3 credits per 50 pages (started). Takes: no input file. Makes: pdf.
The same as a one-step job with the action html_to_pdf, which can be chained with other steps.
Request
curl -X POST https://api.fynepdf.com/v1/pdf/html-to-pdf \
-H "Authorization: Bearer $FYNEPDF_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","layout":"desktop"}'Body
| Parameter | Type | Required | What it does |
|---|---|---|---|
wait | integer | Seconds to wait for the result (default 30). | |
webhook_url | string | ||
metadata | object | Your own keys and values, returned on the job and in webhooks. | |
url | string | ||
html | string | ||
layout | "desktop" · "tablet" · "mobile" | ||
margin | "no" · "small" · "big" |
Response
A job: 200 when it finished within wait (30 seconds by default), 202 if it is still running; then poll it or use a webhook. The receipt says what each step did and cost, and outputs holds the result with a download link (good for an hour; the file is kept 24 hours).
{
"object": "job",
"id": "job_01jc9a2b3c4d5e6f7g8h9j",
"status": "succeeded",
"mode": "live",
"inputs": [],
"steps": [
{
"action": "html_to_pdf",
"params": {
"url": "https://example.com",
"layout": "desktop"
}
}
],
"receipt": {
"steps": [
{
"step": 1,
"action": "html_to_pdf",
"status": "succeeded",
"credits": 1,
"pages_before": null,
"pages_after": 14,
"bytes_before": null,
"bytes_after": 4600000,
"duration_ms": 4200
}
],
"credits": 1,
"credits_quoted": 1,
"duration_ms": 4300
},
"outputs": [
{
"object": "file",
"id": "file_01jc9b7c8d9e0f1g2h3j4k",
"filename": "result.pdf",
"kind": "pdf",
"bytes": 4600000,
"pages": 14,
"download_url": "https://files.fynepdf.com/…",
"expires_at": "2026-11-02T10:30:00.000Z"
}
],
"error": null
}
Errors
Errors are problem details (RFC 9457) with a code you can branch on and a request_id for support.