Print-quality PDFs from Markdown

First-class Japanese typesetting. GFM, math, code highlighting, BibTeX, and cover pages — rendered by Vivliostyle and Chromium.

npx @pfnet-research/pfpdf@latest --input document.md --output document.pdf

No installation step needed — npx fetches and runs pfpdf directly.

document.md
---
title: pfpdf Template Sample
author: pfpdf contributors
date: 2026-08-04
lang: en
---

# 1. Text and Paragraphs

**Strong** and *emphasis*.

Math: $e^{i\pi}+1=0$
pfn template (en sample) — page 1
document.pdf — rendered with the pfn template

Features

GFM Markdown

Standard GitHub syntax for tables, task lists, strikethrough, autolinks, nested lists, and more.

Japanese-friendly emphasis

`これは**「重要」**です` renders as strong emphasis even next to full-width punctuation.

Math and code highlighting

Inline and display math plus fenced code blocks work out of the box with bundled assets.

BibTeX bibliographies

Point front matter at .bib files and use \cite{key} for numbered citations and a reference list.

7 bundled templates + logo injection

From academic to technical. Logos are never bundled — inject yours with --logo PATH.

Redistributable bundled fonts

No dependency on OS fonts by default; host fonts are an explicit opt-in.

Managed rendering

Uses the bundled Vivliostyle CLI and its standard browser management, with an optional explicit browser path.

CI-verified on 4 environments

PDF generation is verified with a real browser on macOS, Linux, and Windows.

Seven templates, one command away

Every template renders the same sample document, so you can compare typography, covers, and density side by side.

Browse the template gallery →

Quick start

  1. 1

    Write Markdown

    A plain .md file with optional front matter for title, author, and template settings.

  2. 2

    Run npx @pfnet-research/pfpdf

    No install needed. Pass a directory to combine its Markdown files into a single PDF.

  3. 3

    Get a print-quality PDF

    Cover page, table of contents, page numbers, and typeset body — ready to print or share.

Convert a directory of chapters at once, and pin the version in CI:

npx @pfnet-research/pfpdf@latest --input docs --output docs.pdf
npx --yes @pfnet-research/pfpdf@0.1.0 --input docs --output docs.pdf

First run: pfpdf downloads Chromium for rendering (several hundred MB). Later runs use the cached browser and work offline for built-in features.