Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/ivoronin/mkd2pdf
- Owner: ivoronin
- Created: 2018-02-23T11:25:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-17T10:18:17.000Z (over 6 years ago)
- Last Synced: 2024-10-31T19:54:39.262Z (12 days ago)
- Topics: chrome-headless, markdown, md2pdf, node, pdf, pdf-generation, phantomjs, prince, princexml, showdown, weasyprint, wkhtmltopdf
- Language: JavaScript
- Homepage:
- Size: 3.08 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
- Stable and fast
- Adds a small logo to the first page of generated PDF files when used with free/non-commercial license.
- Open Source
- A few HTML rendering shortcomings (should be fixed in 0.42.3)
| [Prince](https://www.princexml.com/) |
| [WeasyPrint](http://weasyprint.org/) (Recommended) |
## 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