Skip to content

ivoronin/mkd2pdf

Repository files navigation

mkd2pdf

Renders markdown text in PDF using various renderers.

hit count npm version

Prerequisites

  • Node.js >= 9.0.0
  • One or more of the following software products:

Installing

mkdir mkd2pdf && cd mkd2pdf
npm install mkd2pdf
sudo npm link

Usage

mkd2pdf input.md output.pdf

Please refer to mkd2pdf --help for more information.

Example

lorem ipsum

Supported Renderers

Renderer Pros Cons
Google Chrome
  • Free
  • Intermittent errors, long startup time
  • Page header and footer generation is disabled because of hardcoded contents (local file name, title and date)
  • Does not generate bookmarks
  • Does not support metadata
  • Does not support auto hyphenation
Prince
  • Stable and fast
  • Adds a small logo to the first page of generated PDF files when used with free/non-commercial license.
WeasyPrint (Recommended)
  • Open Source
  • A few HTML rendering shortcomings (should be fixed in 0.42.3)

Metadata mapping

You can specify metadata in markdown document, see example.md for an example.

PDF Prince WeasyPrint
Title title title
Author author author
Subject subject description
Keywords keywords keywords
Creator generator generator

License

This project is licensed under the MIT License