PHPackages                             phppdf/markdown-converter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. phppdf/markdown-converter

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

phppdf/markdown-converter
=========================

Convert Markdown into PDF documents on top of phppdf/phppdf

00PHPCI passing

Since Jun 18Pushed todayCompare

[ Source](https://github.com/phppdf/markdown-converter)[ Packagist](https://packagist.org/packages/phppdf/markdown-converter)[ RSS](/packages/phppdf-markdown-converter/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

markdown-converter
==================

[](#markdown-converter)

[![CI](https://github.com/phppdf/markdown-converter/actions/workflows/ci.yml/badge.svg)](https://github.com/phppdf/markdown-converter/actions/workflows/ci.yml)

Convert Markdown into PDF documents on top of [phppdf/phppdf](https://github.com/phppdf/phppdf).

Markdown is parsed directly into layout primitives (text, lists, tables) — there is no intermediate HTML step.

Installation
------------

[](#installation)

```
composer require phppdf/markdown-converter
```

Requires PHP 8.4+.

Usage
-----

[](#usage)

`MarkdownConverter::fromMarkdown()` never registers fonts for you — you must register a font under each resource name `MarkdownConverterConfig` expects (`F1`–`F5` by default) before calling `$builder->build()`.

```
use PhpPdf\Builder\PdfDocumentBuilder;
use PhpPdf\Markdown\MarkdownConverter;
use PhpPdf\Markdown\MarkdownConverterConfig;
use PhpPdf\Output\PdfMemoryOutput;
use PhpPdf\Serialization\PdfDocumentSerializer;

$markdown = "# Hello World\n\nWelcome to the PDF.";

$config = new MarkdownConverterConfig();

$builder = new PdfDocumentBuilder();
$builder->globalFont($config->getRegularFontName(), 'Helvetica')
    ->globalFont($config->getBoldFontName(), 'Helvetica-Bold')
    ->globalFont($config->getItalicFontName(), 'Helvetica-Oblique')
    ->globalFont($config->getBoldItalicFontName(), 'Helvetica-BoldOblique')
    ->globalFont($config->getCodeFontName(), 'Courier');

MarkdownConverter::fromMarkdown($markdown, $config, $builder);

$output = new PdfMemoryOutput();
(new PdfDocumentSerializer($output))->writeDocument($builder->build());

header('Content-Type: application/pdf');
echo $output->getContent();
```

Supported Markdown
------------------

[](#supported-markdown)

ATX and Setext headings, paragraphs, **bold**, *italic*, ***bold italic***, `inline code`, fenced code blocks, ordered/unordered lists (with nesting and GFM task-list checkboxes), blockquotes, thematic breaks, GFM pipe tables (with column alignment), hyperlinks, standalone images, and footnotes.

See the [full syntax reference and known limitations](https://phppdf.github.io/markdown-converter/docs/supported-markdown/).

Documentation
-------------

[](#documentation)

Full documentation, including custom layout and custom fonts, is available at [phppdf.github.io/markdown-converter](https://phppdf.github.io/markdown-converter/).

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ee7f711ef4d45ada0ac92c7ab2f548055a7cfbe718da6c4bbb81b2f6693c528?d=identicon)[waltertamboer](/maintainers/waltertamboer)

---

Top Contributors

[![waltertamboer](https://avatars.githubusercontent.com/u/508054?v=4)](https://github.com/waltertamboer "waltertamboer (3 commits)")

### Embed Badge

![Health badge](/badges/phppdf-markdown-converter/health.svg)

```
[![Health](https://phpackages.com/badges/phppdf-markdown-converter/health.svg)](https://phpackages.com/packages/phppdf-markdown-converter)
```

###  Alternatives

[42coders/document-templates

Document template management package.

19940.0k](/packages/42coders-document-templates)[qipsius/tcpdf-bundle

A bundle to easily integrate TCPDF into Symfony

23749.5k](/packages/qipsius-tcpdf-bundle)[radnan/rdn-csv

Laminas module to export and import CSV files

19119.3k](/packages/radnan-rdn-csv)[tarfin-labs/easy-pdf

Makes pdf processing easy.

1719.4k](/packages/tarfin-labs-easy-pdf)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.7k](/packages/nilgems-laravel-textract)[akeneo-labs/excel-connector-bundle

Akeneo PIM Excel connector bundle

166.4k](/packages/akeneo-labs-excel-connector-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
