Complete cURL code examples for the PixDoc API
# cURL is pre-installed on macOS, Linux, and Windows 10+Send HTML to the /api/v1/pdf endpoint and save the binary response.
curl -X POST https://pixdoc.dev/api/v1/pdf \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"html": "<h1>Hello World</h1>"}' \
-o output.pdfThe /api/v1/screenshot endpoint returns a PNG image.
curl -X POST https://pixdoc.dev/api/v1/screenshot \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"html": "<h1>Hello World</h1>"}' \
-o screenshot.pngPass a template_id and variables instead of raw HTML.
curl -X POST https://pixdoc.dev/api/v1/pdf \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template_id": "invoice",
"variables": {
"company": "Acme Corp",
"total": "$1,250.00"
}
}' \
-o invoice.pdf