Skip to main content

Generate a PDF file for each MkDocs page

Project description

Mkdocs Page to PDF

An Mkdocs plugin to generate a PDF file for each MkDocs page.

How to use

Install the package with pip:

pip install mkdocs-page-pdf

Enable the plugin in your mkdocs.yml:

plugins:
  # - ...
    - pdf-export # should be last

Options

Options are directly induced from pyppeteer options :

  • scale (float): Scale of the webpage rendering, defaults to 1.
  • displayHeaderFooter (bool): Display header and footer. Defaults to False.
  • headerTemplate (str): HTML template for the print header. Should be valid HTML markup with following classes.
    • date: formatted print date
    • title: document title
    • url: document location
    • pageNumber: current page number
    • totalPages: total pages in the document
  • footerTemplate (str): HTML template for the print footer. Should use the same template as headerTemplate.
  • printBackground (bool): Print background graphics. Defaults toFalse.
  • landscape (bool): Paper orientation. Defaults to False.
  • pageRanges (string): Paper ranges to print, e.g., '1-5,8,11-13'. Defaults to empty string, which means all pages.
  • format (str): Paper format. Defaults to A4.
  • margin (dict): Paper margins.
    • top (str): Top margin, accepts values labeled with units, defaults to 20px.
    • right (str): Right margin, accepts values labeled with units, defaults to 20px.
    • bottom (str): Bottom margin, accepts values labeled with units, defaults to 20px.
    • left (str): Left margin, accepts values labeled with units, defaults to 20px.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs-page-pdf-0.0.5.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_page_pdf-0.0.5-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page