← All microservices
HTML to PDF
PDF
Turn HTML and CSS into a PDF: invoices, receipts, reports, tickets. Rendered by Chromium, so modern CSS (flexbox, grid, web fonts) works.
Create an account
It comes with 10,000 free tokens a month.
What it does
- Chromium rendering: flexbox, grid and web fonts
- A3, A4, A5, Letter, Legal and Tabloid
- Margins, landscape and background colours
- Page numbers in the footer
Good for
- Invoices and receipts
- Tickets and certificates
- Reports
Keep the HTML self-contained: styles inline, and images and fonts as data URIs. For safety, scripts do not run and nothing is fetched from the internet.
Try it now
No account needed. Up to 10 runs a day here, files up to 2MB, and nothing is kept.
Example
POST https://bloodweb.net/api/v1/html-to-pdf
curl -H "Authorization: Bearer YOUR_KEY" --data-urlencode html@invoice.html -d format=A4 https://bloodweb.net/api/v1/html-to-pdf -o invoice.pdf
Complete, tested code for this call: curl · Node.js · Python · PHP
Options
| Name | Description |
|---|---|
filefile |
Optional: an .html file instead of the html parameter, up to 5MB. |
html
|
The HTML. It must be self-contained: inline <style>, and images and fonts as data: URIs. Remote files and scripts are not loaded. |
format
|
Paper size. When format, landscape and margin are all left out, the page's own CSS @page rule decides. One of: A3, A4, A5, Letter, Legal, Tabloid Default: A4 |
landscape
|
Landscape orientation. Default: false |
margin
|
Page margin in millimetres. Default: 10 |
background
|
Print background colours and images. Default: true |
page_numbers
|
Print "Page 1 of 3" at the bottom centre of every page. Default: false |
Returns
A PDF.
Limits
HTML up to 5MB. Scripts do not run and nothing is fetched from the network.
Good to know
- Your files exist on our server only while the call runs, and are deleted when it ends. We keep a record of the call, never the file.
- A call that fails costs nothing.
- Run by Bloodweb (ABN 65 757 166 166) in Australia, under the microservices terms.
- Questions go to support@bloodweb.net, and we reply within one business day.
- Every service is checked every hour: see the status page.