Convert HTML or Markdown content to a PDF server-side using WeasyPrint. Supports custom CSS and handles tables, fonts, and page breaks.
POST /v1/pdf/generatePer document| Field | Type | Description |
|---|---|---|
| content* | string | HTML or Markdown content to convert |
| format | "html" | "markdown" | Input format (default: "html") |
| css | string | Additional CSS to apply (default: empty) |
The endpoint returns { job_id: integer } immediately. Poll GET /jobs/{job_id} until status: "completed" — the result below is in the result field.
| Field | Type | Description |
|---|---|---|
| url | string | Download URL — GET /v1/pdf/{job_id} streams the PDF |
Request
{
"content": "# Invoice #123\n\n| Item | Price |\n|------|-------|\n| Service | €100 |",
"format": "markdown",
"css": "body { font-family: Arial, sans-serif; }"
}Completed job result
{
"url": "/v1/pdf/7"
}