PHPackages                             ikarolaborda/mdtopdf - 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. ikarolaborda/mdtopdf

ActiveLibrary

ikarolaborda/mdtopdf
====================

Simple Markdown to PDF Converter Script

01↓33.3%PHP

Since Sep 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ikarolaborda/mdtopdf)[ Packagist](https://packagist.org/packages/ikarolaborda/mdtopdf)[ RSS](/packages/ikarolaborda-mdtopdf/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Markdown to PDF Exporter
========================

[](#markdown-to-pdf-exporter)

This PHP script converts Markdown files to PDF documents using command-line arguments. It utilizes the Parsedown library for Markdown parsing and Dompdf for PDF generation.

Features
--------

[](#features)

Converts Markdown files to PDF format Accepts input and output file paths as command-line arguments Handles errors gracefully with informative messages Uses PHP 8.3 features and follows object-oriented programming principles

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Composer for dependency management

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

[](#installation)

Install using Composer:

```
composer require ikarolaborda/mdtopdf
```

Usage
-----

[](#usage)

Run the script from the command line, providing the input Markdown file and the desired output PDF file as arguments:

```
php vendor/bin/ikarolaborda/MarkdownToPdfExporter.php
```

Example:

```
php vendor/bin/ikarolaborda/MarkdownToPdfExporter.php input.md output.pdf
```

If successful, you'll see a message confirming that the PDF was generated.

Error Handling
--------------

[](#error-handling)

The script includes error handling for common issues:

- If the input file doesn't exist, an error message will be displayed.
- If there are issues reading the input file or writing the output file, appropriate error messages will be shown.
- If the incorrect number of arguments is provided, usage instructions will be displayed.

Customization
-------------

[](#customization)

- You can modify the MarkdownToPdfExporter class to customize the PDF output (By extending it):
- Adjust the paper size and orientation in the generatePdf method.
- Modify the Dompdf options in the constructor for different PDF settings.

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

This project is open source and available under the MIT License.

Support
-------

[](#support)

If you encounter any problems or have any questions, please open an issue in this GitHub repository.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

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/ac196d3ded6522ebaee82c686db5b1accec4191f09fd47bada5aae2df301184a?d=identicon)[ikarolaborda](/maintainers/ikarolaborda)

---

Top Contributors

[![ikarolaborda](https://avatars.githubusercontent.com/u/12631361?v=4)](https://github.com/ikarolaborda "ikarolaborda (2 commits)")

### Embed Badge

![Health badge](/badges/ikarolaborda-mdtopdf/health.svg)

```
[![Health](https://phpackages.com/badges/ikarolaborda-mdtopdf/health.svg)](https://phpackages.com/packages/ikarolaborda-mdtopdf)
```

PHPackages © 2026

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