mdpdf基础

介绍

技术 特性 适用场景 说明
mdpdf - Github

Quick Start

1
2
3
4
5
6
7
8
# install globally
$ npm install mdpdf -g

# Simple convert using GitHub Markdown CSS and some additional basic stylings
$ mdpdf README.md

# Convert with custom styling with a header of height 22mm
$ mdpdf README.md --style styles.css --header header.hbs --hHeight 22

Options

  • --style= - A single css stylesheet you wish to apply to the PDF
  • --header= - A HTML (.html) file to inject into the header of the PDF
  • --h-height= - The height of the header section
  • --footer= - A HTML (.html) file to inject into the footer of the PDF
  • --f-height= - The height of the footer section
  • --border= - Border (top, left, bottom, right; default: 20mm)
  • --border-top= - Top border (default: 20mm)
  • --border-left= - Left border (default: 20mm)
  • --border-bottom= - Bottom border (default: 20mm)
  • --border-right= - Right border (default: 20mm)
  • --gh-style - Enable default gh-styles, when --style is used
  • --no-emoji - Disables emoji conversions
  • --debug - Save the generated html for debugging
  • --help - Display this menu
  • --version - Display the application version
  • --format= - PDF size format: A3, A4, A5, Legal, Letter, Tabloid (Default: A4)
  • --orientation= - PDF orientation: portrait or landscape (Default: portrait)
坚持原创技术分享,您的支持将鼓励我继续创作!
0%