Skip to main content

A Python CLI to export pages from PDF files as images.

Project description

pdfshot

A Python CLI to export pages from PDF files as images.

Quickstart

  • Install poppler (macOS): brew install poppler.

Usage:

$ pdfshot [OPTIONS] INPUT_PATH PDF_PAGE

Arguments:

  • INPUT_PATH: The input PDF file. [required]
  • PDF_PAGE: The page number of the PDF file to export as an image. Page numbering starts at 1 (1-based indexing). [required]

Options:

  • -b, --add-border: Add border to the page image. [default: False]
  • --version: Show the version and exit.
  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.

Notes

  • pdf2image:
    • To only convert PDF files to images.
  • Commands:
    • poetry init + poetry install.
    • poetry add "typer[all]".
    • which pdfshot.
    • pdfshot test.pdf 1 or pdfshot test.pdf 1 --add-border.
  • Typer:
    • CLI arguments (required by default): CLI parameters (./myproject, for example) passed in some specific order to the CLI application (ls, for example).
    • CLI options (optional by default): CLI parameters (--size, for example) passed to the CLI application with a specific name.
    • Data validation.
    • Numeric validation.
    • For commands, think of git (git push, git clone, etc.).
  • Poetry:

References

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

pdfshot-0.2.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

pdfshot-0.2.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pdfshot-0.2.1.tar.gz.

File metadata

  • Download URL: pdfshot-0.2.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.6.13 Linux/5.4.0-1046-azure

File hashes

Hashes for pdfshot-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9688c31f312423d6a85e8b5ac93585d14f16d35f14a2ff7eddb915e90a3abcf9
MD5 8a1563a36aa87de46675e6983c41abe4
BLAKE2b-256 3c80845cbb2ed8b493016968630bfadacbfe6c1279c7cb54118b857688df4e90

See more details on using hashes here.

File details

Details for the file pdfshot-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pdfshot-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.6.13 Linux/5.4.0-1046-azure

File hashes

Hashes for pdfshot-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 39950f8ea24cef4a8ce272ce1240956dba933f048fe7eea6a87269fba204a1eb
MD5 b28550e903a013325bca4d0ff979779d
BLAKE2b-256 53377f1110e53d3ee8bc81f8cffa9b5f10c973a6e2cc60ebafc15f116de3b735

See more details on using hashes here.

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