Skip to main content

Place user-defined margins around PDF page content

Project description

set-pdf-margins

This script places user-defined margins around the content of each page of a given PDF file. The left and top margins are given explicitly. The right and bottom margins result from explicitly given page sizes in horizontal (x) and vertical (y) directions. The page content is not rescaled. The document outline is preserved. This script is meant to facilitate PDF reading and margin note taking on tablets and e-readers. Note that correctly determining the bounding box of the content of a PDF page is difficult and your mileage may vary depending on your input PDF.

Usage:

$ set-pdf-margins [OPTIONS] PDF_INPUT_PATH MARGIN_LEFT MARGIN_TOP PAGE_SIZE_X PAGE_SIZE_Y

Arguments:

  • PDF_INPUT_PATH: [required]
  • MARGIN_LEFT: [required]
  • MARGIN_TOP: [required]
  • PAGE_SIZE_X: [required]
  • PAGE_SIZE_Y: [required]

Options:

  • --pdf-output-path PATH
  • --unit [pt|mm]: [default: pt]
  • --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.

If your page content is too large to fit on your target page size, or if you want to crop headers, footers, or page numbers before determining the bounding boxes of the actual content of each page, consider preprocessing your file using other tools first.

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

set_pdf_margins-0.1.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

set_pdf_margins-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file set_pdf_margins-0.1.0.tar.gz.

File metadata

  • Download URL: set_pdf_margins-0.1.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for set_pdf_margins-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c3845f6026bb13f724340e486899dc8474346cda4693cb38c1e84e46473182a1
MD5 3b8d1f400377987755f2c911f435e766
BLAKE2b-256 e82c732d1d7a9c517c8206007bf09539a50164f85dd680a92a43cb9c78d62ac8

See more details on using hashes here.

File details

Details for the file set_pdf_margins-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for set_pdf_margins-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe12b5cd6eebf31b42d0762da918655ba062cd7d1a520950eedeea5b6d0490df
MD5 cb379b47a40844086f0053821a2b9e5a
BLAKE2b-256 25c66e11e076cd504a33ac6e55ddf88c7b0e6f8882419d41a9a16b87364f29e7

See more details on using hashes here.

Supported by

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