Skip to main content

Python command line application to convert Markdown to PDF.

Project description


License: MIT Code style: black

Python command line application to convert Markdown to PDF.

Project Features

  • Bare-bones: Only supports basic CommonMark
  • Not necessarily beautiful: Left-aligned, PDF-base14 fonts. Reasonably pretty, but if you want more control, see alternatives below.
  • Images inserted with optional captions and width specifier.
  • File attachments inserted with PDF links.
  • Minimal requirements


There are several projects that can be considered if you need something with more features. Of note:


$ pip install mdpdf


$ mdpdf [OPTIONS] [INPUTS]...


  • -o, --output FILE Destination for file output. [required]
  • -h, --header <template> Sets the header template.
  • -f, --footer <template> Footer template.
  • --version Show the version and exit.
  • --help Show this message and exit.


The <template> is a quoted, comma- delimited string, containing the left, centre, and right, fields for the header/footer. Format is "[left],[middle],[right]".

Possible values to put here are:

  • Empty string
  • Arbitrary text
  • Special variables:
    • {page} current page number
    • {header} current top-level body text heading
    • {date} current date


$ mdpdf -o article.pdf

$ mdpdf -o article.pdf --footer "{date},{heading},{page}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdpdf-0.0.7.tar.gz (13.7 kB view hashes)

Uploaded source

Built Distribution

mdpdf-0.0.7-py3-none-any.whl (14.6 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page