Posts

Showing posts from November, 2019

Convert Markdown Documents to PDF Using md-to-pdf

Image
Convert Markdown Documents to PDF Using md-to-pdfAzure DevOps now has an option to link your Wiki to a repo. With this change I decided to start creating all my documentation in Markdown and then to supply my users with PDF output for things such as user guide. This allows me to source control my documents and still supply users with clean looking outputs. Here is how i went about doing this.Create Documents Folder/PackageI started by creating a new folder for my documents and running the npm init command.Install md-to-pdf from NPMInstall the md-to-pdf npm package by running npm i --save-dev md-to-pdfCreate Index.js fileCreate a index.js file in the root directory of your folder and copy the following code.const mdToPdf = require('md-to-pdf'); const config = { "pdf_options": { "format": "Letter", "margin": "15mm", "displayHeaderFooter": true, "headerTemplate": "<style>section {padding-left…