Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ivoronin/mkd2pdf

Markdown to pdf renderer
https://github.com/ivoronin/mkd2pdf

chrome-headless markdown md2pdf node pdf pdf-generation phantomjs prince princexml showdown weasyprint wkhtmltopdf

Last synced: 5 days ago
JSON representation

Markdown to pdf renderer

Awesome Lists containing this project

README

        

# mkd2pdf
Renders markdown text in PDF using various renderers.

[![hit count](http://hits.dwyl.io/ivoronin/mkd2pdf.svg)](http://hits.dwyl.io/ivoronin/mkd2pdf) [![npm version](https://badge.fury.io/js/mkd2pdf.svg)](https://badge.fury.io/js/mkd2pdf)

## Prerequisites
- Node.js >= 9.0.0
- One or more of the following software products:
- Google Chrome >= 65.0.0
- [Prince](https://www.princexml.com/) >= 11.0
- [WeasyPrint](http://weasyprint.org/) >= 0.42.2

## Installing
```bash
mkdir mkd2pdf && cd mkd2pdf
npm install mkd2pdf
sudo npm link
```

## Usage
```bash
mkd2pdf input.md output.pdf
```
Please refer to `mkd2pdf --help` for more information.

## Example
![lorem ipsum](https://raw.githubusercontent.com/ivoronin/mkd2pdf/master/example/example.png)

## 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](https://www.princexml.com/) |
    • Stable and fast
    |
    • Adds a small logo to the first page of generated PDF files when used with free/non-commercial license.
    |
    | [WeasyPrint](http://weasyprint.org/) (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](https://github.com/ivoronin/mkd2pdf/raw/master/example/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