Skip to content
ButterskiPublic

About

Markdown to PDF in under a millisecond: a small native C++17 CLI for Linux and Windows. Math, code colours, Mermaid, themes, books, PDF/A and PDF/UA, without a browser, LaTeX or Pandoc.

Topics

Resources

Contributing

Stars

25 stars

Watchers

0 watching

Forks

Repository files navigation

RayoMD mascot

RayoMD

Markdown to PDF in under a millisecond, from a single small executable.
No browser. No LaTeX. No Pandoc. No runtime.

Version: 5.3.0 MathTex Downloads License: Apache-2.0

CI Repository Hygiene Release CodeQL Fuzz C++17 Platforms: Windows and Linux GitHub stars rayomd on The Terminal Index

Download · Quick start · Features · Benchmarks · Documentation

Tip

New in 5.3: --serve --json, one warm process for editor plugins and agent tools: each request a JSON line with its own input (a file or the Markdown text), output and flags, answered with its report line; rayomd-mcp is an MCP server on it. Also an Agent Skill for agents with a shell, the container image ghcr.io/butterski/rayomd, smaller packages, and an editor's preview of a large document rebuilt about twice as fast after an edit (TinyPdf::BuildSession).

RayoMD parses Markdown and writes PDF bytes directly, in its own C++17 code: a small command-line tool for Linux and Windows, and an exporter you can embed through the C++ API. The desktop app for Linux and Windows, RayoMD GUI, lives in its own repository.

Highlights

Fast

A short note in under 1 ms, start to exit; a 1024×1024 PNG in 8 to 11 ms, 2 ms once converted. Batches run on up to 64 threads.

Small

A 709 KB Linux download and an 814 KB Windows download. No browser engine, TeX stack or runtime to install.

Math

A TeX subset typeset natively: fractions, roots, sums, matrices, in embedded fonts. No LaTeX.

Code and images

Code coloured as on GitHub in 29 languages; PNG, JPEG, and SVG drawn as vectors.

Books and themes

One PDF from a SUMMARY.md, tables of contents, company fonts, colours, headers and a cover.

Standards

Tagged PDF/UA-1 for screen readers and PDF/A-3b for archives, validated with veraPDF.

Quick start

Linux: download and run
curl -LO https://github.com/Butterski/rayomd/releases/download/v5.3.0/rayomd-5.3.0-linux-x64-static.tar.gz
tar -xzf rayomd-5.3.0-linux-x64-static.tar.gz
./rayomd-5.3.0-linux-x64-static/rayomd --export input.md output.pdf
Windows: the command-line tool, rayomd.exe

Download rayomd-5.3.0-windows-x64.zip from Releases and unpack it. rayomd.exe is the same CLI as on Linux:

rayomd.exe --export input.md output.pdf

Since 5.0.0, rayomd.exe started without arguments prints its usage; up to 4.7.0 it opened a desktop app, which RayoMD GUI replaces.

Build from source

A C and C++17 compiler and CMake; on Linux also a TrueType or OpenType font such as fonts-dejavu-core. On Windows add -G "MinGW Makefiles".

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
./build/rayomd --doctor
./build/rayomd --export input.md output.pdf
Package Size, 5.3.0 For
rayomd-<version>-linux-x64-static.tar.gz 1,094 KB Linux, recommended: no dependency, the fastest start
rayomd-<version>-windows-x64.zip 814 KB Windows: every CLI mode in one rayomd.exe
rayomd-<version>-linux-x64.tar.gz 709 KB Linux: needs only glibc
rayomd-<version>-linux-x64-curl.tar.gz 711 KB Linux with HTTP/HTTPS images through libcurl

Every feature below works the same from both command lines and the C++ API.

Performance

Measured on 2026-10-20 on an AMD Ryzen 5 PRO 4650GE in an Arch Linux container without network, RayoMD 5.2.5 and the other tools in one session. A one-shot export is a fresh process, start to exit.

Against other tools

Each tool converts the repository's tester.md (headings, Unicode text, code, tables, lists, quotes, footnotes and formulas) as a fresh process, median of 20 on four pinned cores.

%%{init: {"themeVariables": {"xyChart": {"plotColorPalette": "#2ea44f"}}}}%%
xychart-beta
    title "tester.md without images, in ms (lower is better)"
    x-axis ["RayoMD", "glu", "Qt 6", "Pandoc + Typst", "Pandoc + WeasyPrint", "md-to-pdf", "Pandoc + XeLaTeX"]
    y-axis "Milliseconds" 0 --> 2200
    bar [1.3, 55, 71, 357, 987, 1821, 2147]
Loading
Tool Version Without images With a 1024×1024 PNG Peak memory Installed size¹ Formulas
RayoMD 5.2.5 1.34 ms 7.58 ms 3.4 MiB 1.3 MiB typeset
glu 0.0.46 55 ms (41×) 86 ms (11×) 33 MiB 25 MiB TeX source
Qt 6 QTextDocument + QPrinter 6.12.0 71 ms (53×) 113 ms (15×) 39 MiB 373 MiB TeX source
Pandoc + Typst 3.11, Typst 0.15.1 357 ms (266×) 397 ms (52×) 239 MiB² 0.65 GiB typeset
Pandoc + WeasyPrint 3.11, WeasyPrint 70.0 987 ms (737×) 1,258 ms (166×) 241 MiB² 0.9 GiB MathML text and TeX
md-to-pdf 5.2.5, Chromium 154 1,821 ms (1,359×) 1,918 ms (253×) 205 MiB² 1.0 GiB TeX source
Pandoc + XeLaTeX 3.11, TeX Live 2026 2,147 ms (1,602×) 3,397 ms (448×) 340 MiB² 1.4 GiB typeset

¹ Approximate: the tool's packages and their dependencies beyond a base Arch Linux image. Qt comes with any Qt desktop. ² The largest single process; these tools run several. The other tools' memory and sizes are from 2026-10-13: the same versions in the same container.

On one core RayoMD takes 1.39 ms (11.1 ms with the PNG, which it re-encodes on up to four cores) and the others 65 ms to 2.3 s. In a running process (--serve, --batch, --bench) each further export takes 0.16 ms.

Note

The documents are tester.md without the five lines that test fallbacks: the remote and missing images and a formula with an unknown TeX command. RayoMD shows those as fallback text; with them XeLaTeX and glu stop with an error, and Pandoc waits on the network. The imageless one also drops the mascot PNG. RayoMD converts the PNG every run (--no-image-cache), as the others do. Pandoc reads markdown+tex_math_single_backslash-raw_tex. Qt prints through a small harness with an 11 pt font. The tools render different Markdown subsets and look different, so this compares time to a finished PDF, not identical output. Method, one-core figures and each tool's output: comparison of 2026-10-20; page renders: comparison of 2026-10-13.

Release by release

The big steps only: 4.0 rewrote the text path in lower-level code and linked the C++ runtime in; 4.1 and 4.2 replaced zlib with RayoMD's own PNG decoder and encoder, a row at a time and on up to four cores; 4.3 writes Unicode text in two bytes a character; 4.4 cuts what a fresh process costs around the export (page faults, libm.so, the output write) and the work per word and per allocation in the export itself. 4.5 and 4.6 add work instead: formulas embed their fonts (tester.md's PDF grows from 75 to 86 KB) and HTML is read, 1 to 9 % on these documents. 5.1 and 5.2 add Mermaid diagrams, Obsidian notes and their embeds, page footnotes, long pages and print output, and the rounds after 5.2.2 went into speed: a fresh export of these documents takes about as long as with 4.6.0 (starting the process is most of it), the essay 11 % less, and an export in a running process 29 % less (tester.md: 0.23 to 0.16 ms). One-shot export onto an existing PDF, one pinned core, median of 40, the five releases measured in one session:

Document 3.2.0 4.0.0 4.4.0 4.6.0 5.2.5
Short note, ASCII 1.78 ms 0.93 ms 0.75 ms 0.77 ms 0.76 ms
Short note, Polish 2.85 ms 1.27 ms 0.85 ms 0.90 ms 0.89 ms
Essay, 10,000 words 2.49 ms 1.63 ms 1.29 ms 1.32 ms 1.18 ms
tester.md, no images 3.32 ms 1.74 ms 1.27 ms 1.36 ms 1.31 ms
README of 4.3.1 (Unicode text) 3.98 ms, 270 KB 2.38 ms, 270 KB 1.71 ms, 221 KB 1.84 ms, 216 KB 1.88 ms, 218 KB
One 1024×1024 RGBA PNG 90.6 ms 29.2 ms 10.7 ms 10.8 ms 10.6 ms

The README row leaves out the README's two images: since 4.6.0 RayoMD draws them as GitHub shows them (5.2.5: 15.4 ms with both converted, 2.9 ms from the image cache), where earlier releases printed the HTML as text.

From 32,768 pixels a converted image is kept in the user cache directory, so its next export, in any process, takes about 2 ms; --no-image-cache turns that off. Text and pixels are the same from 3.2.0 to 4.4.0; 4.5.0 draws bullets as markers and formulas in embedded fonts, and 4.6.0 renders HTML. The fully static Linux edition starts another 0.2 to 0.3 ms sooner.

Every change is profiled on a real export, rewritten, and kept only if a pinned A/B shows it faster and the PDF bytes (for a re-encoded image, the pixels) stay the same, unless changing them is its purpose. performance.md says how the numbers are taken and lists what is left in the profiles and what was tried and rejected; what each change gained is in the wiki's Performance History, and older reports are in the benchmark index.

back to top ↑

Features

Markdown

GitHub-flavoured Markdown as people write it. Headings become PDF bookmarks and #anchor targets, bullets are drawn as a browser draws them (a disc, a circle one level in, then squares), and a table's header row repeats on every page it reaches:

# Report

Text with **bold**, *italic*, ~~strike~~, `code` and a [link](https://example.com).
A bare URL like https://example.com and an address like [email protected] are clickable.

- [x] Task lists
- Nested bullet and numbered lists
  1. like this one

> [!WARNING]
> GitHub alerts: NOTE, TIP, IMPORTANT, WARNING and CAUTION.

| Item | Price |
|:-----|------:|
| Tea  |  2.50 |

A sentence with a footnote.[^1]

[^1]: Set after the text, linked both ways, or with --footnotes=page at the foot of the page.

Also reference links (full, collapsed and shortcut), <…> autolinks, rules, page breaks (\pagebreak, \newpage, <!-- pagebreak -->), <br>, character references such as &copy;, and hidden HTML comments. A link to a javascript:, vbscript:, data: or file: URL, a drive path (C:\…) or a network share (\\host\share) keeps its text but is not made clickable, in Markdown as in HTML. Unicode text uses an embedded subset of a system font (or the one RAYOMD_FONT names, TrueType or OpenType: .ttf, .otf, .ttc) with fallback fonts for other scripts, Noto Sans CJK first for Chinese, Japanese and Korean; Latin text stays on the PDF standard fonts, which keeps those files small.

Footnotes are set after the text, as GitHub shows them. With --footnotes=page each note goes to the foot of the page of its first reference, as in a book: a line that does not leave room for its notes moves to the next page with them, a note only other notes refer to goes with the first of them, and a note too tall for a page stays after the text. In a book, each file's notes stay on its own pages.

rayomd --export thesis.md thesis.pdf --footnotes=page

HTML in Markdown

Inline HTML as GitHub shows it: <b>, <i>, <s>, <code>, <kbd>, <u>, <mark>, <sup> and <sub>, <a href>, <q>, <br>, and <img> as its alt text. Other tags are removed and their text kept; <script>, <style> and the like are left out with their content, and links follow the same URL rules as Markdown links.

HTML blocks become what they stand for: align="center" or "right" and <center> place the text, headings and images inside (also Markdown between an opening and a closing <div>), <img width height> sizes an image, a paragraph of images shows them side by side, a block element's id, <a id> or <a name> is a #link target, and <details>/<summary>, <pre>, <blockquote>, lists, tables and <dl> become their Markdown counterparts. Markdown inside an HTML block shows as written, as on GitHub.

<div align="center">
  <a id="top"></a>
  <img src="logo.png" width="120" alt="Logo"> <img src="badge.png" alt="Badge">

# A centred title

Press <kbd>Ctrl</kbd>+<kbd>C</kbd>, then <mark>paste</mark>: H<sub>2</sub>O, E = mc<sup>2</sup>.
</div>

<p align="right"><a href="#top">back to top</a></p>

Obsidian notes

--dialect=obsidian reads a note as Obsidian shows it: callouts of any of Obsidian's types, with their own titles, folded or not (both print unfolded) and nested; ==highlights==; %%comments%%, also over several lines, left out; [[wiki links]] to a note (note.md), a heading in it or in this note; and ![[embedded images]], sized with |300 or |300x200 when the image has a line of its own. In a book (--book), a wiki link finds its note by name wherever it is. Block ids (^id at a line's end) are left out. --hide-tags leaves #tags out (not in code, formulas or comments; #1984 is no tag), each with a space next to it; a line of tags alone becomes a blank line.

A note embedded on a line of its own, ![[Note]], is printed in its place: the whole note (without its front matter), ![[Note#Heading]] that heading's section, ![[Note#^id]] the paragraph or list item that block id marks. Embedded notes may embed others, 8 deep; their footnotes and images (from their own folder) come with them, their headings join the table of contents. A note is found next to the embedding note, then from the vault's top, then by name anywhere in it; --vault=DIR sets the vault (default: the note's folder), and nothing outside it is read. A cycle, a missing note, the 1,001st embed or past 32 MiB of embedded text stay links, as do embeds in lists and quotes, and every embed with --embeds=link or from stdin.

> [!tip]- Before you start
> Read [[Setup#Requirements|the requirements]] and ==back up== the vault. %%draft%%

![[diagram.png|300]]

![[Setup#Requirements]]
rayomd --export note.md note.pdf --dialect=obsidian --vault="$HOME/Notes" --hide-tags

Code highlighting

Fenced code in one of 29 languages is coloured as GitHub's light theme colours it: shell, console, PowerShell, batch, JavaScript, TypeScript, Python, C, C++, C#, Java, Kotlin, Go, Rust, Swift, PHP, Ruby, SQL, HTML, XML, CSS, SCSS, JSON, YAML, TOML, INI, Dockerfile and diff. --no-highlight draws every block in one colour.

```python
def greet(name):
    return f"Hello, {name}"
```

Diagrams

A ```mermaid block is drawn as its diagram, laid out by RayoMD itself as vector graphics in the document's font, with no browser or Node.js: flowcharts (flowchart/graph, every shape and link, subgraphs, classDef and style), sequence diagrams (participants, messages, activations, notes, loops and other frames, autonumber), pie charts, state diagrams (composite states, choices, forks and joins, notes), class diagrams (members, generics, annotations, relations with cardinalities, namespaces, notes), ER diagrams (attributes with keys, crow's-foot cardinalities), XY charts (bars and lines), gantt charts (sections, after dependencies, milestones, excluded days), timelines, quadrant charts (points with their own styles and classes), user journeys (sections, scores as faces, actors), kanban boards (cards with tickets, assignees and priorities), packet diagrams (bit fields over rows of 32 bits), mind maps and git graphs (branches, merges, cherry-picks, tags). A theme's Rayo palette colours them (Themes). Other diagram types, and anything past the limits in native_mermaid.md, show their source as a code block, as does every block with --no-diagrams.

```mermaid
flowchart LR
    A[Write Markdown] --> B{Diagrams?}
    B -->|yes| C[Drawn natively]
    B -->|no| D[Code block]
```

Math

A TeX subset typeset natively, with no LaTeX, in text, lists, quotes, headings and table cells, also in PDF/A. The formula fonts are built in (TeX Gyre Termes outlines) and embedded with the glyphs a document uses, so formulas look the same in every viewer. Unknown or malformed input degrades to readable output; see native_math.md.

The roots are $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.

$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$

Images

![Revenue by quarter](charts/revenue.svg)
![Team photo](photos/team.jpg)
  • PNG and JPEG, sized to the page; a missing or unreadable image shows its alt text, and an image inside a paragraph reads image: alt. A warning on standard error counts the images that could not be shown and names the flags that would admit them.

  • A PNG with transparency is re-encoded once: from 32,768 pixels on it is kept in the user cache directory (~/.cache/rayomd/images, on Windows %LOCALAPPDATA%\RayoMD\cache\images; at most about 256 MB), so later exports of the same image skip the work. The PDF is the same either way; --no-image-cache keeps nothing.

  • --fast-images re-encodes such a PNG faster, for image streams a few percent larger (the pixels are the same): a 1024x1024 one about 1 ms sooner on one CPU.

    rayomd --export report.md report.pdf --fast-images
  • SVG drawn as vectors by RayoMD's own converter: paths, shapes, transforms, clipping, linear gradients, opacity, text in the document's font, embedded PNG/JPEG, and Illustrator style sheets. Charts from matplotlib, Vega-Lite, Plotly and Graphviz draw close to a browser; an SVG that needs scripts or HTML (Mermaid) shows its alt text.

  • Local images must lie in the input file's folder unless --allow-unsafe-local-images; HTTP/HTTPS images load only with --allow-url-images (Windows, and the curl Linux build).

Page layout

Styles elegant (default), modern and tech; margins compact, normal, wide, margin=0.75in, margin=54pt or margin=1.5cm (in, pt, cm, mm); page sizes a4 (default), a3, a5, letter, legal, each also -landscape, or any WIDTHxHEIGHT in mm, cm, in or pt; page numbers ("N"; "N / M" with a theme's footer-center = {page} / {pages}). A new page starts at \pagebreak, \newpage or <!-- pagebreak -->, at the HTML page breaks other tools are given (<div style="page-break-after: always"></div>, break-before: page, class="page-break"), and with --page-break-before=h1 before each chapter heading (h2: and each section).

--page-size=210mmxauto (any width and unit) makes one long page for reading on screen: no page breaks but the explicit ones, each page cut just below its text. Images, diagrams and formulas are still fitted to a page of the width times √2, and a document longer than 200 inches (about 900 lines) goes on to a second long page.

rayomd --export report.md report.pdf modern wide --page-size=letter-landscape --page-numbers
rayomd --export notes.md notes.pdf --page-break-before=h1
rayomd --export notes.md notes-screen.pdf --page-size=210mmxauto

Document metadata

The YAML front matter fills the PDF's metadata and is not shown on the page. Without a title the first heading is the title; description stands in for subject. The Producer names the RayoMD version that made the file, as in RayoMD Native Standard PDF followed by the version.

---
title: Quarterly report
author: [Ann Smith, Bob Lee]
subject: Sales in Q3
keywords: [sales, q3]
lang: en-GB
---

Tables of contents

A paragraph [TOC] or [[_TOC_]] becomes a table of contents with dot leaders, page numbers and links to the headings; --toc puts one first, and --toc-depth=N (1 to 6, default 3) sets how many heading levels it lists. --number-headings numbers the headings 1, 1.1, 1.1.1 (to --number-headings=N levels, default 3) in the text, the table of contents and the bookmarks; a document's title heading stays unnumbered, and #links keep working.

rayomd --export handbook.md handbook.pdf --toc --toc-depth=2 --number-headings

Themes

--theme=FILE lays a company look over a style: your TrueType or OpenType font with its bold, italic and bold italic faces (each optional; headings, bold text and table headers in the bold one), heading, link and accent colours, a header and footer with placeholders ({title}, {author}, {subject}, {date}, {page}, {pages}, {logo}) and a logo, and a cover page. Paths are relative to the theme file, and theme fonts and logos are local files: on Windows, network (UNC, WebDAV, mapped network drive) and device paths are refused. See Themes.

The theme's Rayo palette colours diagrams and the document's own parts: --rayo-* keys whose names other Rayo tools share. --rayo-fg (body text, list bullets, table cells, diagram labels), --rayo-muted (the header and footer, the cover's subject and date, the contents' dots, secondary diagram text), --rayo-surface (code blocks, inline code, table headers, diagram nodes), --rayo-border (table borders, node borders), --rayo-line, --rayo-surface-alt, --rayo-note, --rayo-accent, --rayo-critical and --rayo-series-1 to --rayo-series-8 (diagrams: edges, groups, notes, highlights, critical tasks, pie slices and other series). Quotes, alerts and highlighted code keep their colours. The palette was inspired by Obsidian's Pele, which themes Mermaid diagrams with CSS variables.

Example theme file
font = fonts/AcmeSans-Regular.ttf
font-bold = fonts/AcmeSans-Bold.ttf
font-italic = fonts/AcmeSans-Italic.ttf
font-bold-italic = fonts/AcmeSans-BoldItalic.ttf
heading-color = #0B3D91
link-color = #0B6E4F
accent-color = #F2A900
header-left = {logo}
header-right = {title}
footer-left = {author}
footer-right = {date}
logo = acme-logo.svg
cover = yes
--rayo-surface = #EEF3FB
--rayo-border = #0B3D91
--rayo-series-1 = #0B3D91
--rayo-series-2 = #F2A900

Books

--book makes one PDF of several files: those a SUMMARY.md lists (mdBook and GitBook, with parts and nesting), a folder's files by name with README.md first, or the files given. Each starts on a new page, links between them (other.md#heading) stay links inside the PDF, the bookmarks nest by part, and --toc gives one table of contents for the whole book. A book's files may total 128 MiB, as much as one document, and a SUMMARY.md lists each file once (another name for it, such as a link, counts as the same file). The files a SUMMARY.md lists or a book folder holds must lie in that folder, also once links and .. are resolved, so a book from elsewhere cannot put your other files into its PDF.

--follow-links[=N] makes a book of a note and the notes it links to, N links deep (1 to 6, default 1): breadth first, in the order of the links, each note once, at most 1,000 notes (the command says how many it left out). Relative .md links count, and with --dialect=obsidian wiki links and embeds, found as embeds are, inside the vault. --backlinks ends each file of any book with "Linked from:" and links to the files that link to it.

rayomd --book docs/src/SUMMARY.md manual.pdf --toc --page-numbers
rayomd --export Project.md project.pdf --dialect=obsidian --follow-links=2 --backlinks

Where the PDF goes

Without an output name, --export notes.md writes notes.pdf beside the Markdown, also with options in its place; a folder as the output gets notes.pdf in it. - writes the PDF to standard output for pipes, with --stdin too, and never to a terminal. Any other name gets .pdf unless it ends in it, in any letter case.

rayomd --export notes.md --toc                  # notes.pdf
rayomd --export notes.md pdfs/                  # pdfs/notes.pdf
cat notes.md | rayomd --stdin - > notes.pdf

Batch conversion

--batch converts the .md and .markdown files of a folder on up to 64 threads (6 by default) and says so when there are none; --recursive mirrors its subfolders, --skip-unchanged keeps PDFs newer than their Markdown, and --report writes one JSON line per document (- for standard output). --stdin converts Markdown piped in, --stdin-batch converts the paths piped in, and --serve stays running and converts each path it reads, answering one line per document.

rayomd --batch docs pdf-out --recursive --skip-unchanged --report=report.jsonl --workers=8
cat notes.md | rayomd --stdin notes.pdf

Front ends: --serve --json

--serve --json keeps one process running for an editor plugin, an agent tool or a script: each line in is a JSON request with its own input (a file, or the Markdown text with the file it stands for), output and export flags; each line out is the request's --report record with its id. The first line out is {"rayomd":"VERSION","protocol":1}; a bad request gets an error line and the session goes on. The PDFs are byte for byte those of --export with the same flags.

printf '%s\n' '{"id":"1","input":"notes/a.md","output":"out/a.pdf","args":["--toc","--page-size=a5"]}' \
  '{"id":"2","markdown":"# Title\n\n![logo](logo.png)","source_path":"notes/b.md","output":"out/b.pdf"}' \
  | rayomd --serve --json

Compression, archiving and accessibility

  • --compress writes page content, fonts and CMaps as FlateDecode streams with RayoMD's own DEFLATE encoder: text-heavy PDFs come out two to five times smaller.
  • --pdfa writes PDF/A-3b for archiving: every font embedded (the formula fonts too), an sRGB output intent, XMP metadata and a file identifier.
  • --pdfua writes tagged PDF/UA-1 for screen readers: headings, lists, tables with header scope, figures with their alt text, formulas, links and footnotes in reading order, decoration marked as artifacts; the language is the front matter's lang, else en.

PDF/A and PDF/UA need a TrueType or OpenType font to embed; PDF/UA shows formulas as their TeX source. Together the file claims both, and every test document passes veraPDF. See Archival and Accessible PDFs.

rayomd --export policy.md policy.pdf --pdfa --pdfua --compress

Printing

--black-text makes a PDF for a black-and-white printer: text, links, headings, code, quote bars and rules come out black, fills (code blocks, table headers, highlights) in light greys of their colours' luminance, and diagrams in a grey palette, each series (pie slice, bar, line) a grey of its own. Images keep their colours, and nothing moves: only the colours change.

rayomd --export report.md report.pdf --black-text --page-numbers

Reversible PDFs

--embed-source attaches the exact Markdown to the PDF and --recover-source gets it back byte for byte; --inspect-source describes it.

Important

Embedding is off by default: the file then carries the whole source, including anything not shown on the pages. See Reversible PDFs.

rayomd --export notes.md notes.pdf --embed-source
rayomd --recover-source notes.pdf recovered.md

Agents

skills/rayomd is an Agent Skill for agents that write Markdown and have a shell: getting the binary and checking its SHA-256, the commands for the common asks, checking the result (pages, failed_images, missing_characters) and what to do when a count is not zero, and in references/syntax.md what renders and what degrades. Releases also publish a container image, the static binary on scratch with DejaVu Sans (about 1.5 MB), for CI jobs and sandboxes; RayoMD GUI shows the live preview of a note an agent rewrites.

cp -r skills/rayomd ~/.claude/skills/
docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/w" ghcr.io/butterski/rayomd --export notes.md notes.pdf

Diagnostics

--doctor checks fonts, temporary output and a smoke export; --bench times repeated exports of one document; --version prints the version. --help also lists the exit codes and the font variables RAYOMD_FONT and RAYOMD_FALLBACK_FONT; every code is in the CLI Reference.

rayomd --doctor
rayomd --bench report.md bench-out 200 modern normal

back to top ↑

Boundaries

Note

RayoMD's renderer is a fast Markdown subset, not a Pandoc clone. When you need the things below, use Pandoc, LaTeX or a browser renderer.

It does not promise full CommonMark/Pandoc compatibility, complete LaTeX math (packages, macros, automatic numbering), highlighting for every language, citations, filters, templates, right-to-left scripts (Arabic and Hebrew are drawn left to right, unshaped), complete SVG (radial gradients and patterns are approximated; markers, filters and masks are not drawn), all of Mermaid (fifteen of its diagram types are drawn, a subset of each; Mermaid's own layout is not copied exactly), or HTML/CSS layout (inline styles, classes and style sheets are read only for page breaks). Under --pdfua a theme's cover page is tagged as decoration and an inline formula is text showing its TeX source. Missing or unsupported images and malformed math degrade to readable fallbacks instead of failing the export. The complete matrix is in Native Markdown Support.

Documentation

Topic Guide
Installation and builds Getting Started
Commands, flags and exit codes CLI Reference
Folders, reports, incremental runs Batch Conversion
One PDF of many files Books
Fonts, colours, headers, cover pages Themes
PDF/A-3b and PDF/UA-1 Archival and Accessible PDFs
Supported Markdown subset Native Markdown Support
Exact source recovery and privacy Reversible PDFs
Embedding the exporter C++ API
Release assets and dependencies Packaging and Releases
Benchmarks and caveats Benchmarks
Regression measurement Performance Watcher

Engineering contracts stay beside the code: performance.md, native_math.md, reversible_pdf_profile.md and arbitrary_pdf_research_decision.md.

Contributing

Read AGENTS.md and CONTRIBUTING.md first. A change to hot code comes with before/after measurements and byte-identical output unless changing the output is its purpose; benchmark claims stay dated and scoped; builds, PDFs and corpora stay out of the repository.

Contributors

Star history

Star history chart

License

RayoMD is released under the Apache License 2.0; see LICENSE. NOTICE lists the third-party code and the runtime libraries linked into the release binaries.

back to top ↑

About

Markdown to PDF in under a millisecond: a small native C++17 CLI for Linux and Windows. Math, code colours, Mermaid, themes, books, PDF/A and PDF/UA, without a browser, LaTeX or Pandoc.

Topics

Resources

Contributing

Stars

25 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages