mkd2pdf
v1.0.2
Published
Renders markdown text in PDF using Google Chrome headless mode
Downloads
115
Readme
mkd2pdf
Renders markdown text in PDF using various renderers.
Prerequisites
- Node.js >= 9.0.0
- One or more of the following software products:
- Google Chrome >= 65.0.0
- Prince >= 11.0
- WeasyPrint >= 0.42.2
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
Supported Renderers
| Renderer | Pros | Cons | |---|---|---| | Google Chrome | Free | Intermittent errors, long startup timePage header and footer generation is disabled because of hardcoded contents (local file name, title and date)Does not generate bookmarksDoes not support metadataDoes 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