node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



A command line utility to convert .md files into PDF files.


It's that easy!


[sudo] npm install pdfplease -g

You need to install it globally, because it's a command line interface, not something you can require in your code (not yet anyway).




But there are some other options too.

Would you like to supply your own CSS file?

pdfplease -c style.css

Would you like to supply your own HTML file?

pdfplease -h container.html

Or do both...

pdfplease -c style.css -h container.html

Supplying your own HTML file

There's a small catch! pdfplease looks for a tag with an id of #content, and drops the resulting HTML (converted from the markdown file) in that. If you don't have a tag with an id of content, your PDF will be empty. You can use the following as a really simple starting point.

<!DOCTYPE html>
        <div id="content"></div>