A Metalsmith plugin to export files to PDF.
Internally, it uses Chrome in headless mode with
Puppeteer to generate a PDF version
of any file registered in Metalsmith with
Because of Puppeteer, this plugin requires at least Node v6.4.0.
$ npm install metalsmith-pdfize
const metalsmith = ;const pdfize = ;metalsmith
pdfize function accepts an option object with 2 entries:
pattern: a multimatch pattern(s) matching files that should be loaded and exported to PDF
printOptions: an object that is directly passed to puppeteer
Page#pdf()function to control headless Chrome behaviour. See Puppeteer documentation for available options.
PDF files are registered into Metalsmith files list. Generated PDF files are
named after the file used as source with the
page/cv/index.html, the generated PDF path will be
metalsmith-pdfize does not support file
metalsmith-renamer can be
used if you need to rename generated PDF.