PDF Generation Text Markdown Invoice Template API
Free tier included · BusinessPDF Generation API turns JSON payloads into formatted PDF documents using four input modes: plain text with optional title/author, CommonMark Markdown (with tables and strikethrough), line-by-line layouts with title/heading/body styles, and structured invoice generation with automatic subtotal, tax, and discount calculations. A template engine fills `{variable}` placeholders into text documents. All rendering happens offline on ReportLab with bundled DejaVu fonts covering Latin and Cyrillic scripts.
Use cases: backend services generating reports, invoices, or summaries from data; no-code pipelines producing PDF deliverables; automated document workflows where you control layout without HTML/CSS complexity. The invoice endpoint computes totals automatically — provide line items, tax rate, and discount, and receive a clean PDF invoice.
The service is stateless with no persistent storage. Heavy rendering runs in a threadpool; when saturated, requests return 503 to retry shortly. Input limits: text/markdown bodies up to 500,000 characters, line arrays up to 20,000 items. Font sizes clamp to 6–96 points. Cyrillic renders visually correct, though text extraction from generated PDFs may vary by reader.
Honest limits: this is not an HTML-to-PDF engine — raw HTML in Markdown is dropped, and only http/https/mailto links are preserved.
Endpoints
| Method | Path | What it does |
|---|---|---|
GET | / | API metadata: name, version, and paths to the interactive docs and health endpoint. |
GET | /health | Liveness probe; returns status "ok" while the process is up. |
POST | /from-text | Generate a PDF from plain text with an optional title and author. Blank lines separate paragraphs. Body and title combined must not exceed 500,000 characters. |
POST | /from-lines | Generate a PDF from an explicit line-by-line layout. Each line has a style (title/heading/body) and optional font size (clamped to 6–96). Empty text renders vertical spacing. Up to 20,000 lines, total text under 500,000 characters. |
POST | /from-markdown | Generate a PDF from CommonMark Markdown with tables and strikethrough. Supports headings h1-h6, paragraphs, lists, block quotes, code blocks, inline code, bold, italic, links (http/https/mailto), images as alt text, and horizontal rules. Raw HTML tags are dropped. Response header X-Missing-Glyphs counts characters the font cannot render (e.g. CJK). |
POST | /invoice | Generate a professional invoice PDF with automatic subtotal, tax, and discount calculations. Provide invoice ID, sender and client addresses, line items (description, quantity, unit_price), optional tax rate (0–100%), discount amount, and currency symbol. |
POST | /from-template | Render a PDF by filling {variable} placeholders in a template string with provided key-value variables. |
Quick start
curl -X POST "https://pdfgen.p.rapidapi.com/from-text" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-H "X-RapidAPI-Host: pdfgen.p.rapidapi.com" \
-H "Content-Type: application/json" \
-d '{"title": "Quarterly Report", "body": "Hello world.\n\nSecond paragraph with more detail.", "author": "Kopilka"}'
FAQ
What input formats does the API support?
Four modes: plain text (`/from-text`), CommonMark Markdown (`/from-markdown`), line-by-line layouts with styles (`/from-lines`), structured invoices (`/invoice`), and template substitution (`/from-template`).
Does the API store my documents or data?
No. The service is stateless with no persistent storage. Generated PDFs are returned immediately and not retained.
What are the size and complexity limits?
Text and Markdown bodies up to 500,000 characters. Line arrays up to 20,000 items. Font sizes clamp to 6–96 points. Up to 100 line items per invoice. When the render queue is saturated, requests return 503 to retry shortly.
Does the API support HTML input?
No. This is a text-native PDF generator, not an HTML-to-PDF engine. Raw HTML tags in Markdown input are dropped. Only http/https/mailto links are preserved.
Try PDF Generation Text Markdown Invoice Template free
Free tier on every plan. Get an API key and start calling in under a minute.
Open on RapidAPI