Convert Markdown files to well-formatted PDF documents
Project description
Markdown to PDF Converter
A pip-installable Markdown to PDF converter with a command-line interface built on ReportLab and Matplotlib.
Features
- Converts Markdown files to styled PDF documents
- Supports headings, lists, block quotes, code blocks, tables, images, and math
- CLI with required input and optional output
- Configurable font family
- Configurable color scheme
- Configurable page size
Installation
Install from this project directory:
pip install .
After installation, the CLI command is available as:
md-to-pdf
CLI Usage
md-to-pdf INPUT [OUTPUT] [--font FONT] [--color-scheme {classic,mono,warm}] [--page-size {A4,LETTER,LEGAL}]
Argument Behavior
INPUTis required.OUTPUTis optional. If omitted, output is created next to the input file with.pdfsuffix.--fontcan be passed.--color-schemecan be passed.--page-sizecan be passed.
Examples
Convert with default output path:
md-to-pdf Docs/initial_proposal_v2.md
Convert with explicit output path:
md-to-pdf Docs/initial_proposal_v2.md Docs/initial_proposal_v2_custom.pdf
Convert with custom font:
md-to-pdf Docs/initial_proposal_v2.md --font "Times New Roman"
Convert with warm color scheme and LETTER page size:
md-to-pdf Docs/initial_proposal_v2.md --color-scheme warm --page-size LETTER
Python API Usage
from pathlib import Path
from md_to_pdf import markdown_to_pdf
markdown_to_pdf(
Path("Docs/initial_proposal_v2.md"),
Path("Docs/initial_proposal_v2.pdf"),
font="serif",
color_scheme="classic",
page_size_name="A4",
)
Notes
- Dependencies are installed automatically through pip:
reportlab,matplotlib - Image paths in Markdown are resolved relative to the input Markdown file
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file md_to_pdf_converter-0.1.1.tar.gz.
File metadata
- Download URL: md_to_pdf_converter-0.1.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b25f50c004296b81fc29408fdd6b302301646a692e38b2ed6e6c735b7d14c207
|
|
| MD5 |
300270b04ac463617bc79133e22861ae
|
|
| BLAKE2b-256 |
a7d4224e2a281ef1fa5a753e308683c84d41325d00a51ceeb2bc9926930319af
|
Provenance
The following attestation bundles were made for md_to_pdf_converter-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on hoseinmrh/Markdown-to-PDF-Converter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
md_to_pdf_converter-0.1.1.tar.gz -
Subject digest:
b25f50c004296b81fc29408fdd6b302301646a692e38b2ed6e6c735b7d14c207 - Sigstore transparency entry: 2026769291
- Sigstore integration time:
-
Permalink:
hoseinmrh/Markdown-to-PDF-Converter@7252150d3367a6940159e4610650243bb87eebc2 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/hoseinmrh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7252150d3367a6940159e4610650243bb87eebc2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file md_to_pdf_converter-0.1.1-py3-none-any.whl.
File metadata
- Download URL: md_to_pdf_converter-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8f9b496d8c23517bf331602913717a7f3dfcb7135d60336e258652e639ea2cf
|
|
| MD5 |
693b7add11ff9b912e8cdf919a361953
|
|
| BLAKE2b-256 |
5475748cdbd18e36f57d02854b4963fcdd5b0c662d4c130690576428126264a9
|
Provenance
The following attestation bundles were made for md_to_pdf_converter-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on hoseinmrh/Markdown-to-PDF-Converter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
md_to_pdf_converter-0.1.1-py3-none-any.whl -
Subject digest:
b8f9b496d8c23517bf331602913717a7f3dfcb7135d60336e258652e639ea2cf - Sigstore transparency entry: 2026769393
- Sigstore integration time:
-
Permalink:
hoseinmrh/Markdown-to-PDF-Converter@7252150d3367a6940159e4610650243bb87eebc2 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/hoseinmrh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7252150d3367a6940159e4610650243bb87eebc2 -
Trigger Event:
release
-
Statement type: