MD PDF

Markdown to PDF

A GitHub Action that converts Markdown or Word documents into polished PDFs while preserving layout, fonts, and template styling.

Sample PDF output rendered by the action
Sample PDF output — tables, code blocks, charts, and more

Features

What this action does out of the box.

→

Markdown → PDF

Feed it a .md file; it converts to Word then PDF automatically.

W

Word → PDF

Already have a .docx file? Pass it directly — no markdown step needed.

≡

Table auto-fix

Tables automatically resize to fit the page with clean, visible borders.

F

Font substitution

Fonts render correctly — including Calibri replacement and Microsoft core fonts.

#

Embedded images

Images referenced in markdown are embedded in the DOCX and rendered in the PDF.

+

Zero-config setup

Everything is auto-installed — no setup required. Just point it at your file and run.

P

Section page breaks

Opt into page_breaks: sections and each H1 heading starts a new page — perfect for reports.

A

Arial or default font

Switch between the default Calibri/Carlito and Arial via font: arial. Code blocks render in Inconsolata.

{ }

Code block styling

Enable code_block_style: true for a light background and smaller font on code blocks.

Sample outputs

Pre-built PDFs are available for download on the releases page, generated from the sample document — a real-world example with tables, code blocks, charts, and extensive formatting. Each major section starts on a new page for a book-style layout.

FileSourceDownload
complex-document-source.md Markdown Download
complex-document.docx DOCX Download
complex-document-from-docx.pdf DOCX → PDF Download
complex-document-from-markdown.pdf Markdown → PDF Download

PDF previews — rendered from the sample document:

Portfolio allocation chart from sample PDF

Markdown → PDF

Candlestick chart from sample PDF

DOCX → PDF

Usage

Add a step to your GitHub Actions workflow.

From a Markdown file • workflow.yml
- name: Convert Markdown to PDF
  uses: bryanpaget/markdown-to-pdf@main
  with:
    markdown_file: "docs/readme.md"
    pdf_file:      "output/readme.pdf"
From a Word document • workflow.yml
- name: Convert Word to PDF
  uses: bryanpaget/markdown-to-pdf@main
  with:
    docx_file: "output/document.docx"
    pdf_file:  "output/document.pdf"
With all opt-in features • workflow.yml
- name: Convert Markdown to PDF
  uses: bryanpaget/markdown-to-pdf@main
  with:
    markdown_file: "docs/report.md"
    pdf_file:      "output/report.pdf"
    code_block_style: "true"
    page_breaks:      "sections"
    font:             "arial"

Inputs

InputRequiredDescription
docx_filenoPath to the source Word document (.docx/.doc)
markdown_filenoPath to a Markdown file (auto-converted to .docx first)
pdf_fileyesPath where the resulting PDF should be written
code_block_stylenoWhen true, code blocks get a light background and smaller font
page_breaksnoWhen sections, each H1 heading starts on a new page
fontnoWhen arial, switches the document font to Arial

Provide either docx_file or markdown_file — not both.

Outputs

OutputDescription
pdf_fileResolved path to the generated PDF