BizKitHub

PDF Generator

Simple API service for generating professional PDF documents from HTML content. Designed for invoices, contracts, reports and internal documentation. Supports printable page margins, custom page width, and receipt-style PDFs with automatic height.

API endpoint
POST https://pdf.bizkithub.com/generator
Send the HTML as request body (text/html or plain text). Query parameters control layout, margins, paper size and receipt mode.
Query parameters
Parameter
Type
Behavior
content
string
HTML content to render. Usually sent as POST body. For GET requests it can be provided as ?content=.
format
string
Standard paper format (e.g. A4, Letter, …). Used when width is not set. Default is A4.
width
string
Custom page width (CSS length, e.g. 80mm, 210mm, 800px). When set, it overrides format and makes the page size explicit.
height
string
Custom page height (CSS length). Used only in fixed-size mode. If width is set and fitHeight is not enabled, the default height behaves like A4 height (297mm).
autoHeight
boolean
Switches from zero margins to print-safe margins that apply consistently across pages. This improves page breaks and prevents content from being cut off at page edges.
margin
string
Overrides margin size when autoHeight=true. Accepts CSS shorthand (1–4 values), e.g. 12mm 10mm or 2mm.
fitHeight
boolean
Receipt mode: generates a single-page PDF whose height is derived from rendered content. Ideal for receipts and long single documents where pagination is not desired. Works best together with width (e.g. 80mm).
uuid
string
Optional identifier. If provided, it is stored in PDF metadata keywords.
author
string
Optional author label included in PDF metadata (Author/Creator/Producer).
Defaults: without autoHeight margins are zero. With autoHeight=true the service applies sensible print margins (A4-style for standard pages, smaller margins for narrow receipt widths). Use margin to override.
How combinations work
1) Paper sizing priority
If width is provided, it becomes the primary sizing input and overrides format. If height is also provided, the page size is fully explicit. If only width is provided (and fitHeight is not enabled), a standard page height is used as default.
2) Margins are controlled by autoHeight
By default, the service renders with zero margins. When autoHeight=true is enabled, margins are applied consistently across pages, improving print correctness and page breaks. Use margin to override the default margin size.
3) Receipt mode (fitHeight)
When fitHeight=true is enabled, the PDF is generated as a single page whose height is derived from the rendered content. This avoids pagination and is best used with a fixed width (e.g. 80mm) and small margins.
Examples
Default (zero margins)
Renders content edge-to-edge. Best for full-bleed designs or when you fully control your own internal padding in HTML.
POST https://pdf.bizkithub.com/generator
A4 with print-safe margins (recommended for multi-page documents)
Enables consistent per-page margins so page breaks don’t clip content.
POST https://pdf.bizkithub.com/generator?autoHeight=true
Custom narrow page width with print-safe margins (receipt-like pagination)
Useful for narrow documents that can still paginate (e.g. very long receipts or logs).
POST https://pdf.bizkithub.com/generator?autoHeight=true&width=80mm
Receipt mode: single page height derived from content
Ideal for thermal receipts: no pagination, height is computed from rendered content.
POST https://pdf.bizkithub.com/generator?autoHeight=true&fitHeight=true&width=80mm&margin=2mm
Custom margin size (small margins for receipts)
Override margins when autoHeight is enabled. Accepts CSS shorthand (1–4 values).
POST https://pdf.bizkithub.com/generator?autoHeight=true&width=80mm&margin=2mm
Explicit page size using width + height
For fully controlled page sizing (e.g. labels, tickets).
POST https://pdf.bizkithub.com/generator?autoHeight=true&width=100mm&height=150mm&margin=4mm
Tip: in multi-page mode, keep your HTML layout “print friendly” (avoid fixed-height containers for long content). For receipts in fitHeight mode, keep content width responsive and let text wrap naturally.
Open full documentation
BizKitHub · Simple PDF Service