Markdown & HTML to PDF / DOCX Generator (Reports, Invoices) avatar

Markdown & HTML to PDF / DOCX Generator (Reports, Invoices)

Pricing

Pay per event

Go to Apify Store
Markdown & HTML to PDF / DOCX Generator (Reports, Invoices)

Markdown & HTML to PDF / DOCX Generator (Reports, Invoices)

Turn Markdown or HTML into PDF and Word (DOCX) files with themes, page numbers, a table of contents, code highlighting, tables, images and JSON templating (built-in invoice). No JavaScript is executed; files stay in the run's storage under normal Apify retention.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Nick Hellmich

Nick Hellmich

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

11 days ago

Last modified

Share

Turn Markdown or HTML into polished PDF and Word (DOCX) files, plus HTML if you want it. It's built for AI agents and automations that need to deliver real documents: reports with a table of contents, invoices from JSON data, briefs and documentation. It's the companion to Document to Markdown & RAG Chunks.

Quick start

  1. Click Start. The prefill renders a short status report (a table and code) to PDF and DOCX for $0.005.
  2. Paste your Markdown or HTML, upload .md / .html files, or paste links. GitHub file pages, Google Docs and Dropbox share links are converted automatically.
  3. Open the Output tab and click PDF or DOCX to download.

Features

  • 3 themes: clean, classic and modern. Page size (A4, Letter, Legal, A5), landscape orientation and margins.
  • Headers and footers with {page}, {pages}, {title} and {date}. A table of contents with page numbers.
  • Code highlighting, GitHub-style tables, footnotes, task lists and images (URLs or data URIs).
  • Non-Latin text: CJK, Arabic, Hebrew, Devanagari, Cyrillic, Greek and emoji.
  • Templating: {{ placeholders }} and loops filled from JSON data, plus a built-in invoice template that computes the totals.
  • Custom CSS for the PDF and HTML outputs.

Examples

{ "markdown": "# Q3 Report\n\n## Summary\n...", "tableOfContents": true, "headerText": "{title}", "formats": ["pdf", "docx"] }
{ "template": "invoice", "formats": ["pdf"], "data": { "invoiceNumber": "INV-0042", "date": "2026-10-10", "currency": "USD", "taxRate": 8.25,
"seller": { "name": "Acme LLC", "address": "100 Main St\nAustin, TX" }, "client": { "name": "Globex Corp" },
"items": [ { "description": "Consulting", "quantity": 10, "unitPrice": 120 } ] } }

Output

There's one row per document with pdfUrl, docxUrl and htmlUrl download links, plus pages, charged, warnings (for example, a blocked image) and error:

{ "index": 0, "title": "Weekly status report", "ok": true, "pages": 1, "charged": true,
"pdfUrl": "https://api.apify.com/v2/key-value-stores/.../records/ab12cd-Weekly-status-report.pdf",
"docxUrl": "https://api.apify.com/v2/key-value-stores/.../records/ab12cd-Weekly-status-report.docx" }

Pricing (pay per event)

EventPrice
Document generated, in all requested formats, including its first 10 pages$0.005
Extra page beyond 10$0.0005

Examples: an invoice costs $0.005; a 14-page report costs $0.007; a 100-page report costs $0.05. Failed documents are never charged. Bronze, Silver and Gold plans get 10/20/30% off.

Fidelity notes

  • PDF is rendered by WeasyPrint, a print-CSS engine. It handles running headers, page counters and TOC page numbers very well. JavaScript is never run, so charts drawn by scripts won't appear; use images or SVG instead.
  • DOCX is produced by pandoc. Headings, lists, tables, code, images, footnotes, headers and footers with page numbers, page size and margins all carry over. Custom CSS and complex layouts (flex or grid) are simplified. Word fills in TOC page numbers when it updates fields on open.

Limits and safety

  • Limits: 20 documents per run, 5 MB of text per source, 300 pages per document and 180 s of rendering per document. Remote images, styles and fonts share a 60 s, 50 MB budget per document.
  • Remote resources are fetched through an SSRF-safe fetcher that blocks private and metadata addresses and re-checks every redirect. Links in your document are never fetched.
  • Privacy: inputs are deleted after each document and content is never logged. Generated files stay in the run's key-value store under Apify's normal retention, and anyone with a link can download them.

FAQ

Can I use my own fonts or styles? Use customCss (for PDF and HTML). Remote @font-face URLs are fetched safely. Why is an image missing? Check warnings. The URL may be private, too large or blocked. GitHub README? Paste the github.com file link; it's converted to the raw file. Relative image paths in it won't resolve. Can an AI agent use it? Yes, through the Apify API or MCP, and it supports x402 payments.

Integrations: no-code and AI

Zapier: new Airtable/Sheets row → invoice PDF emailed to the client

  1. Trigger: Google Sheets → New Spreadsheet Row (invoice number, client, line items).
  2. Action: Apify → Run Actor → Markdown & HTML to PDF / DOCX Generator, run synchronously (it renders in a few seconds; if it times out, use the Finished Actor run trigger instead). Input: {"template": "invoice", "formats": ["pdf"], "data": {"invoiceNumber": "{{Invoice}}", "client": {"name": "{{Client}}"}, "items": [{"description": "{{Item}}", "quantity": {{Qty}}, "unitPrice": {{Price}}}]}}.
  3. Search: Fetch dataset items → Gmail Send Email with the pdfUrl link (or attach the file after downloading it with Webhooks GET).

Make: ChatGPT report → branded DOCX in Google Drive

OpenAI Create a Completion (ask for Markdown) → Apify Run an Actor ({"markdown": "{{choices[].message.content}}", "formats": ["docx", "pdf"], "theme": "modern", "tableOfContents": true}) → Get Dataset Items → HTTP Get a file (docxUrl) → Google Drive Upload a File.

n8n: AI agent that "hands over" real documents

In an AI Agent node, add the Apify Tool → Run an Actor and get dataset with this Actor, and click the sparkle icon so the model fills markdown. The agent writes the report, calls the tool and replies with pdfUrl.

LangChain: give your agent a "make PDF" tool

from langchain_apify import ApifyActorsTool
make_pdf = ApifyActorsTool("steady_kahikatea/markdown-html-to-pdf-docx")
make_pdf.invoke({"run_input": {"markdown": "# Weekly summary\n\n- Revenue up 8%", "formats": ["pdf"]}})

(LlamaIndex: the reader classes load data into an index; to produce documents, call this Actor through apify-client, or wrap it as a FunctionTool.)

Sample input → output: {"markdown": "# Q3 Report\n...", "formats": ["pdf", "docx"], "tableOfContents": true} → {"ok": true, "pages": 4, "pdfUrl": "https://api.apify.com/.../Q3-Report.pdf", "docxUrl": "https://api.apify.com/.../Q3-Report.docx", "charged": true}. Cost: $0.005.

Tip: Zapier's synchronous Run Actor times out after 30 seconds. For anything longer, run it asynchronously and start a second Zap from the Finished Actor run trigger. Make's synchronous timeout depends on your plan; use Watch Actor Runs for long jobs.

Also works with: the Apify API ("API" tab), the Apify MCP server for Claude/Cursor-style agents, and x402 payments.

Docs used: Zapier · Make · n8n · LangChain · LlamaIndex

For AI agents

Actor: steady_kahikatea/markdown-html-to-pdf-docx
Input: {"markdown": "# Title\n...", "formats": ["pdf"]} or {"template": "invoice", "data": {...}}
Output: rows with pdfUrl, docxUrl, htmlUrl, pages, charged, error

Licenses

WeasyPrint (BSD-3), markdown-it-py (MIT), Pygments (BSD-2), Jinja2 (BSD-3), python-docx (MIT) and Noto fonts (OFL). pandoc (GPL-2) runs as a separate, unmodified program.

Questions? Use the Issues tab. If it's useful, a rating helps others find it.