Markdown to PDF Converter: Generate Professional PDFs
Pricing
$5.00 / 1,000 pdfs
Markdown to PDF Converter: Generate Professional PDFs
Convert Markdown or native Typst markup into professionally typeset PDFs: reports, invoices, papers, and documentation. Headings, bold/italic, lists, tables, and links are preserved and properly formatted, not just printed HTML. Powered by Typst, the open-source typesetting system.
Pricing
$5.00 / 1,000 pdfs
Rating
0.0
(0)
Developer
Raion Al
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Markdown to PDF Converter: Generate Professional PDFs from Markdown & Typst
Convert Markdown or native Typst markup into a properly typeset PDF: invoices, reports, papers, changelogs, and documentation that need to look professionally formatted, not just a webpage printed to PDF.
Powered by Typst (Apache-2.0, 55,000+ GitHub stars), the modern open-source typesetting system built as a faster, easier-to-write alternative to LaTeX. Markdown input is translated to Typst markup via Pandoc's (GPL-2.0) mature, AST-based Markdown parser and typst writer, not a hand-rolled regex translation.
Great for: markdown to pdf, markdown to pdf converter, markdown to pdf api, generate pdf from markdown, text to pdf converter, invoices, reports, one-pagers, academic papers, changelogs, documentation exports, and any pipeline that needs a real typeset PDF instead of a rendered HTML page.
Important: which markup dialect are you sending it?
This actor accepts two different markup dialects. Pick the right one in the format field:
markdown(default). Standard Markdown / CommonMark: the#heading,**bold**,- list,| table |syntax you already know. It is automatically translated to Typst markup for you before typesetting.typst. Typst's own native markup language. Typst is not Markdown. It looks similar for headings and bold/italic, but has its own syntax for everything else: tables via#table(...), math via$...$, function calls via#name(...). A literal#or$in your text must be escaped as\#/\$, even in native mode.
What the Markdown → Typst translation actually covers: headings, bold/italic, ordered/unordered lists (including nested lists), tables (including column alignment), links, images, blockquotes, code blocks (with syntax highlighting), and inline code. Pandoc's translator correctly escapes literal Typst-special characters that survive from your source text, so a stray #, $, or _ in a sentence stays literal text instead of being misread as Typst code. This was specifically tested against exactly that kind of input, not assumed.
Markdown parsing is intentionally lenient: malformed Markdown degrades gracefully instead of erroring, the same way a browser tolerates broken HTML. Typst compilation is strict: a real syntax error in typst mode fails that one document with a precise line/column diagnostic, without affecting the other documents in the same run.
What it does
Give it one or more documents, Markdown or Typst markup, and it returns a downloadable PDF for each: properly typeset with real typography rather than a browser print dialog. Consistent heading hierarchy, clean list indentation, ruled tables, and a clean default page layout (A4, 2.5cm margins, page numbers) that you can override per run.
Example input
{"documents": ["# Invoice\n\n**Bill to:** Acme Corp\n\n| Item | Price |\n|---|---|\n| Consulting | $1,500 |\n"],"format": "markdown","paperSize": "a4","margin": "2.5cm"}
Input fields
| Field | Description |
|---|---|
documents | Array of documents to convert. One PDF is produced per item. |
format | markdown (default, auto-converted via Pandoc) or typst (native markup, untouched). |
paperSize | a4 (default), us-letter, a3, a5, or us-legal. |
margin | Page margin on all four sides, e.g. 2.5cm, 1in, 20mm. |
maxDocuments | Safety cap on documents processed per run (default 20). |
Output
One row per document:
| Field | Description |
|---|---|
index | Position of the document in the input array |
format | Dialect used (markdown or typst) |
paperSize / margin | Page setup used for that document |
pdfUrl | Direct link to download the generated PDF |
sizeBytes | Size of the generated PDF, in bytes |
status | ok or error |
error | Present only when status is error: a plain-text diagnostic, including the Typst line/column when applicable |
Pricing
Billed per PDF successfully generated. Documents that fail to convert (for example, a genuine Typst syntax error in native mode) are not charged.
FAQ
How do I convert Markdown to PDF?
Paste your Markdown into documents (leave format as markdown) and run. Each array item becomes one PDF, linked from the pdfUrl field in the output row.
Is this the same as printing an HTML page to PDF? No. It typesets your content with Typst, a real typesetting engine in the same spirit as LaTeX, rather than a headless browser printing a styled webpage. Headings, tables, and lists get consistent, deliberate typography instead of whatever CSS happened to produce.
Does it support tables, code blocks, and links? Yes, in both dialects. Markdown tables (with column alignment), fenced code blocks (with syntax highlighting), and links all carry through correctly into the PDF.
What happens if my Markdown has a literal # or $ in the text, not a heading or math?
It's preserved as literal text. The Markdown-to-Typst translation escapes Typst's special characters whenever they're not meant to trigger Typst syntax.
What happens if I submit broken Typst syntax in typst mode?
That document's row comes back with status: "error" and the exact Typst compiler diagnostic, including line and column. Other documents in the same run are unaffected.
Can I control page size and margins?
Yes, via paperSize and margin. For anything more advanced (custom fonts, headers/footers, multi-column layout), switch to format: "typst" and add your own #set page(...) / #set text(...) rules in your document; they override this actor's defaults for content after that point.
Why does this exist instead of just using a Markdown-to-HTML-to-PDF tool? Browser-print-to-PDF tools inherit whatever CSS a page happens to load and are optimized for screens, not print. Typst is a purpose-built typesetting engine (same category as LaTeX), so headings, tables, and page breaks come out looking like an actual printed document by default.
What is Typst, if I haven't heard of it? Typst is a modern (2023+) open-source alternative to LaTeX with 55,000+ GitHub stars, built to be faster and far easier to write while producing the same caliber of typeset output. This actor exists so you can get that output quality from plain Markdown, without learning Typst yourself, and it's also available directly for anyone who already knows Typst.
Please note
Only convert content you have the right to process. Documents are processed transiently for the duration of the run; generated PDFs live in the run's key-value store and are not retained beyond Apify's standard storage retention.
Built with the Apify Python SDK, Typst (Apache-2.0), and Pandoc (GPL-2.0) for Markdown parsing.