Release
PDFops v0.12: HTML to PDF, text and tables out of PDFs, stamps and e-invoices
v0.11 was the page-operations release. v0.12 is about what is inside a PDF and where one comes from. You can now turn an HTML string into a PDF, pull text and tables out of a PDF as JSON, CSV or an Excel workbook, find a phrase and stamp next to it, add fillable fields to a flat file, attach files, build a PDF from images, Markdown or CSV, and write an invoice that carries its own machine-readable data. The TypeScript SDK, the Python client, the MCP server and the n8n node on npm all cover it.
Every sample below runs as written, with no signup: the keyless
trial allows 100 calls per IP a month. To count calls against a key
instead, add -H "X-API-Key: $PDFOPS_API_KEY" to any
of them. They build on each other, so run them in order in one
folder.
HTML to PDF
POST /api/html-to-pdf
takes an HTML string and returns a PDF. A headless browser on our
side lays it out, so CSS, images and web fonts come out as they do
in a browser print, on A4 or Letter pages.
curl -X POST https://pdfops.dev/api/html-to-pdf \
-H "Content-Type: application/json" \
-d '{"html": "<!doctype html><style>body{font-family:Arial,sans-serif;margin:0}h1{color:green}table{width:100%;border-collapse:collapse}td,th{border-bottom:1px solid gray;padding:6px;text-align:left}</style><h1>Invoice 1042</h1><table><tr><th>Item</th><th>Qty</th><th>Amount</th></tr><tr><td>Widget</td><td>2</td><td>USD 40.00</td></tr><tr><td>Gadget</td><td>1</td><td>USD 15.50</td></tr><tr><td>Total</td><td></td><td>USD 55.50</td></tr></table><p>Thank you.</p>", "page_size": "a4"}' \
-o invoice.pdf
The limits are part of the feature. It takes HTML text only: no URL input, and JavaScript is switched off, so a page that builds itself in the browser renders empty. External resources load over https from public hosts only, and the document can run to 50 pages. It costs 5 requests of quota per call, not 1, and once the renderer is reached a failed render counts too. Unlike every other endpoint, its output is not byte-identical between runs, because a browser wrote it.
Text out of PDFs
POST /api/extract-text
reads a born-digital PDF, one made by software such as an invoice
system or a bank, and returns each page's text in reading order,
every line with its position, and any tables as rows of cells.
tables_format asks for the tables as CSV text, or as one
Excel workbook with a sheet per table. Here is the invoice from above
as CSV, then as a workbook:
curl -X POST https://pdfops.dev/api/extract-text \
-F "pdf=@invoice.pdf" \
-F "tables_format=csv" \
| jq -r '.pages[].tables[].csv' > tables.csv
curl -X POST https://pdfops.dev/api/extract-text \
-F "pdf=@invoice.pdf" \
-F "tables_format=xlsx" \
-o tables.xlsx
Tables are found from where the text sits, so borderless ones work.
A cell whose text wraps comes back as an extra row, and two tables
side by side come back as one. There is no OCR: a scanned page is
listed in pagesWithoutText. In the workbook every cell
is text, so a value that starts with = is never a formula.
POST /api/find-text
searches the same text layer for a literal or a regular expression and
returns each hit with its page and box, in the coordinates
edit uses. So a hit feeds the next call directly.
Building and marking up PDFs
POST /api/edit draws text,
PNG or JPEG images and barcodes at exact positions on the pages you
name. Barcodes, QR codes included, are drawn as vector shapes, so they
scan at any size. This finds a total, writes a note beside it and
puts a QR code in the corner:
HIT=$(curl -s -X POST https://pdfops.dev/api/find-text \
-F "pdf=@invoice.pdf" -F "query=USD 55.50" | jq -c '.hits[0]')
ITEMS=$(echo "$HIT" | jq -c '[
{type:"text", page:.page, x:(.x + .width + 8), y:.y, size:.height, text:"paid"},
{type:"barcode", page:1, x:480, y:40, format:"qrcode", value:"https://example.com/invoice/1042", width:72}
]')
curl -X POST https://pdfops.dev/api/edit \
-F "pdf=@invoice.pdf" \
-F "items=$ITEMS" \
-o stamped.pdf
POST /api/add-fields
creates fillable fields in a flat PDF: text, multiline text,
checkboxes, radio groups, dropdowns and empty signature boxes, each at
a page and a rectangle. It signs nothing. Fill the result with
fill-form:
curl -X POST https://pdfops.dev/api/add-fields \
-F "pdf=@stamped.pdf" \
-F 'fields=[{"type":"text","name":"approved_by","page":1,"x":72,"y":80,"width":200,"height":20},{"type":"checkbox","name":"paid_in_full","page":1,"x":72,"y":110,"width":14,"height":14}]' \
-o fillable.pdf
curl -X POST https://pdfops.dev/api/fill-form \
-F "pdf=@fillable.pdf" \
-F 'fields={"approved_by":"Jordan Lee","paid_in_full":"true"}' \
-o approved.pdf
Three smaller ones, each one call:
attachembeds up to 10 files in a PDF, with a name, a description and a PDF/A-3 relationship such asData. Listing attachments back is not in the API yet;qpdf --list-attachmentsdoes it.image-to-pdfmakes one page per JPG or PNG, sized to the image or to A4 or Letter.mergenow accepts images among its inputs too.text-to-pdflays out Markdown, plain text or CSV on the built-in fonts. It is not HTML to PDF: no HTML or CSS, no custom fonts, WinAnsi characters only.
curl -X POST https://pdfops.dev/api/attach \
-F "pdf=@invoice.pdf" \
-F "file=@tables.csv;type=text/csv" \
-F 'options=[{"name":"tables.csv","description":"Invoice lines","relationship":"Data"}]' \
-o with-data.pdf
curl -X POST https://pdfops.dev/api/image-to-pdf \
-F "pdf=@page1.png" \
-F "pdf=@page2.png" \
-F "page_size=a4" \
-o photos.pdf
curl -X POST https://pdfops.dev/api/text-to-pdf \
-H "Content-Type: application/json" \
-d '{"content": "# Release notes\n\nVersion **0.12** is out.\n\n- HTML to PDF\n- Text and tables out of PDFs", "title": "Release notes", "page_numbers": true}' \
-o notes.pdf
Factur-X e-invoices
POST /api/invoice
takes "e_invoice": "factur-x" and returns a PDF/A-3 file
with the invoice data embedded as factur-x.xml, in the
EN 16931 profile of Factur-X, also called ZUGFeRD. The page and the
XML are computed by the same code with exact decimal arithmetic, so
they cannot disagree. The mode needs more fields than a plain invoice,
such as a currency, structured addresses, a seller VAT id and a unit
code on every item; a request that misses any gets a 400 that lists
every missing field.
curl -X POST https://pdfops.dev/api/invoice \
-H "Content-Type: application/json" \
-d '{
"e_invoice": "factur-x",
"invoice_number": "INV-0042",
"date": "2026-11-22",
"due": "2026-12-22",
"currency": "EUR",
"from": {"name": "Acme GmbH", "street": "Hauptstrasse 1", "postcode": "10115", "city": "Berlin", "country": "DE", "vat_id": "DE123456789"},
"to": {"name": "Globex SARL", "street": "1 rue de la Paix", "postcode": "75002", "city": "Paris", "country": "FR"},
"tax_rate": 19,
"items": [
{"description": "Consulting", "quantity": 10, "unit_price": 120, "unit": "HUR"},
{"description": "Setup fee", "quantity": 1, "unit_price": 250, "unit": "C62"}
]
}' \
-o einvoice.pdf
qpdf --list-attachments einvoice.pdf
The exact limits of the claim: the output of every variant in our test suite is checked with the Mustang validator 2.26.0 (PDF/A-3 through veraPDF, the Factur-X schema and the EN 16931 schematron), and a file counts only when both halves pass. That is a statement about the tests we ran. It is not a certification and not advice on what a tax authority or a buyer's system accepts in your country. We do not produce XRechnung, Peppol or UBL, any other Factur-X profile, credit notes, discounts or charges, and an invoice carries one VAT category and rate. A Factur-X call costs 1 request.
The same operations in every client
The point of a small API is that each wrapper can carry all of it. Published on 22 November 2026, each of these covers everything above:
- TypeScript:
pdfops-sdk0.7.0 on npm addshtmlToPdf,textToPdf,imageToPdf,extractText,extractTextPlain,extractTablesXlsx,findText,edit,addFieldsandattach. It is a server-side client built onfetch: it runs on Node 18+ and on Cloudflare Workers, the two runtimes we ran it on. It does not work from a browser page, because the API sends no CORS headers, and a key shipped in page code is public. - Python:
pdfops0.4.0 on PyPI adds the same assnake_casemethods, still with zero dependencies, and is tested on Python 3.9, 3.12 and 3.13. - MCP:
pdfops-mcp0.5.0 on npm, also in the MCP registry, addspdf_edit,pdf_extract_text,pdf_find_text,pdf_add_fields,pdf_add_attachment,pdf_image_to_pdf,pdf_text_to_pdfandpdf_html_to_pdfto the local server. The hosted server athttps://pdfops.dev/api/mcpalready had them. - n8n:
n8n-nodes-pdfops0.5.0 is on npm with eight new operations (add fields, edit, attach, extract text, find text, HTML to PDF, images to PDF and text to PDF) and a Factur-X switch on Generate Invoice. n8n has not approved 0.5.0 yet. The version n8n has verified, and the one n8n Cloud installs, is still 0.4.0, so only a self-hosted install from npm gets 0.5.0. - Zapier and Make: the Zapier app is at 1.0.1 with four actions: fill form, inspect, merge and invoice. None of the new endpoints are Zap actions yet; use a Webhooks step. There is nothing published for Make.
from pdfops import PdfOps
client = PdfOps() # reads PDFOPS_API_KEY from the environment
page = client.html_to_pdf("<h1>Invoice 1042</h1><p>Total USD 55.50</p>", page_size="a4")
open("from-html.pdf", "wb").write(page.pdf)
result = client.extract_text("invoice.pdf", tables_format="csv")
for table in result["pages"][0]["tables"]:
print(table["csv"])
hit = client.find_text("invoice.pdf", "USD 55.50")["hits"][0]
print(hit["page"], hit["x"], hit["y"])
Fixed and hardened
- Clients no longer follow redirects with your key. The TypeScript SDK, the Python client, the MCP server and the n8n node now refuse a 3xx instead of following it, so an
X-API-Keyheader and a request body can never travel on to another origin. - The TypeScript SDK works on Cloudflare Workers with its default fetch. In 0.3.0 to 0.6.0 it stored the global
fetchon the client and called it as a method, which Workers reject. 0.7.0 wraps the call, sonew PdfOps()needs no customfetchthere. - The Python client is tested on 3.9, 3.12 and 3.13, and now sends a fixed content type for common attachment file extensions instead of reading the machine's MIME database, which gave different answers on different boxes.
Also since v0.11
- Requests may run for up to 60 seconds. A request that goes past that is stopped by the platform with a plain-text 504, not the usual error JSON.
Try it
Turn Markdown into a PDF, with no signup. The keyless trial allows 100 calls per IP a month:
curl -X POST https://pdfops.dev/api/text-to-pdf \
-H "Content-Type: application/json" \
-d '{"content": "# Hello\n\nA PDF from one call.", "page_numbers": true}' \
-o hello.pdf
A free key from /docs/signup raises that to 250 calls a month, no card. HTML to PDF counts 5 of them per call. A workflow these endpoints still do not cover, PDF to image, OCR and Office conversion among them, is the most useful thing you can tell us.
← All posts · Docs · Pricing