Skip to main content

An MkDocs plugin to convert the first page of a pdf to an image

Project description

mkdocs-pdf2image-plugin

This plugin generates images from the first page of PDF files. It is particularly useful when you want to include PDF presentations in your documentation.

Installation

Install the package with pip:

pip install mkdocs-pdf2image-plugin

Note that this plugin uses Edouard Belval's pdf2image package, which requires Poppler to be installed on your system. Read the installation instructions on the pdf2image repository for more information.

Activate the plugin in mkdocs.yml:

plugins:
  - search
  - pdf2image:
        src:
            - path/to/*.pdf
            - other/**/file.pdf
        dpi: 300
        format: png

Configuration

The plugin supports the following configuration options:

Option Description
src A list of path names to convert (see documentation for details).
dpi Image quality in DPI (default 200).
fmt Output image format. Valid options are jpg and png. Defaults to jpg.
size Size of the generated image, defaults to (None, None) or !!python/tuple [NULL, NULL] in YAML.
extension Output file extension, defaults to fmt option.
force Force image creation, defaults to false. It true, the generation is done even if the image already exist.

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_pdf2image_plugin-0.1.2.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_pdf2image_plugin-0.1.2-py3-none-any.whl (3.6 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