/api/v1/disk/store-pdf
Generates a PDF from provided HTML using the BizKitHub PDF generator parameters, stores it in blob storage, and returns a public download URL.
Sizing priority: width overrides format. Optional height makes page size explicit. autoHeight enables print-safe margins; margin overrides them. fitHeight enables single-page receipt mode.
This endpoint requires a valid API key passed as a query parameter or Bearer token.
Get your API keyParameters
12 body parameters
htmlContentstringrequiredHTML content to render into PDF. This is sent as the generator request body (compressed).
filenamestringrequiredOriginal filename. The service normalizes it, appends a random suffix, and forces the .pdf extension.
tagstringOptional storage tag (internal metadata label).
formatstringStandard paper format (e.g. A4, Letter, …). Used when width is not set. Default is A4.
widthstringCustom page width (CSS length, e.g. 80mm, 210mm, 800px). When set, it overrides format.
heightstringCustom page height (CSS length). Used in fixed-size mode. When width is set and fitHeight is not enabled, height defaults like A4 height behavior.
autoHeightbooleanEnables print-safe margins consistently across pages (improves page breaks and prevents edge clipping).
marginstringOverrides margin size when autoHeight=true. CSS shorthand (1–4 values), e.g. "12mm 10mm" or "2mm".
fitHeightbooleanReceipt mode: generates a single-page PDF whose height is derived from rendered content. Works best with width (e.g. 80mm).
uuidstringOptional identifier stored in PDF metadata keywords.
authorstringOptional author label in PDF metadata (Author/Creator/Producer). If omitted, defaults to organisation name.
debugbooleanAdds debug CSS borders to the rendered HTML for layout inspection (internal).
Example Request
JavaScript fetch
const response = await fetch("https://api.bizkithub.com/api/v1/disk/store-pdf", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"htmlContent": "<!doctype html><html><body><h1>Invoice #123</h1></body></html>",
"filename": "invoice-123.pdf",
"tag": "invoice",
"format": "A4",
"width": "80mm",
"height": "150mm",
"autoHeight": true,
"margin": "12mm 10mm",
"fitHeight": true,
"uuid": "order_123",
"author": "BizKitHub",
"debug": true
})
});
const data = await response.json();
console.log(data);Example Response
{
"success": true,
"downloadUrl": "https://storage.xhp.cz/...",
"token": "abc123...",
"blobPath": "pdf/2026-01/invoice_..._R4nd0mStr1ng.pdf",
"size": 153042
}cURL
Command line example
curl -X POST "https://api.bizkithub.com/api/v1/disk/store-pdf" \
-H "Content-Type: application/json" \
-d '{
"htmlContent": "<!doctype html><html><body><h1>Invoice #123</h1></body></html>",
"filename": "invoice-123.pdf",
"tag": "invoice",
"format": "A4",
"width": "80mm",
"height": "150mm",
"autoHeight": true,
"margin": "12mm 10mm",
"fitHeight": true,
"uuid": "order_123",
"author": "BizKitHub",
"debug": true
}'Need an API key?
All BizKitHub API endpoints require authentication via API key.