Skip to main content

A PDF CLI tool.

Project description

cli-pdf is a command-line tool that provides various functionalities for PDF manipulation, including encryption, decryption, splitting, merging, and renaming PDF fields.

Features

  • Encrypt and decrypt PDF files using a password.

  • Split PDF files by specifying a page number.

  • Merge two PDF files into one.

  • Rename form fields in a PDF.

  • Read and save field names from PDF forms.

Installation

You can install cli-pdf via pip:

pip install cli-pdf

Alternatively, you can install it from source by cloning the repository:

git clone https://github.com/Personal-DevTools/cli-pdf
cd cli-pdf
pip install .

Usage

Once installed, you can use the tool from the command line with the pdftool command:

pdftool -i input.pdf -o output.pdf --encrypt -p "yourpassword"

Command-line options:

  • -i, --input: Specify the input PDF file.

  • -o, --output: Specify the output PDF file.

  • -rf, --readfieldnames: Read and print form field names in the PDF.

  • -rn, --renamefieldnames: Rename form field names using a JSON mapping.

  • -m, --merge: Merge two PDF files.

  • -s, --split: Split a PDF at a specific page number.

  • -dc, --decrypt: Decrypt a PDF with a password.

  • -ec, --encrypt: Encrypt a PDF with a password.

  • -p, --password: Specify the password for encryption/decryption.

Examples

  • Encrypting a PDF:

    pdftool -i input.pdf -o encrypted.pdf --encrypt -p "yourpassword"
  • Decrypting a PDF:

    pdftool -i encrypted.pdf -o decrypted.pdf --decrypt -p "yourpassword"
  • Splitting a PDF at page 3:

    pdftool -i input.pdf --split 3
  • Merging two PDFs:

    pdftool -i file1.pdf -m file2.pdf -o merged.pdf

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please submit a pull request on the GitHub repository.

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

cli_pdf-1.0.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

cli_pdf-1.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file cli_pdf-1.0.0.tar.gz.

File metadata

  • Download URL: cli_pdf-1.0.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for cli_pdf-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0b9c817355316fe732a5e35dd477dcf7895416a3e0c1d017bbb2c7f4a7e4d86e
MD5 0eb33f6578b20563edd47f8fd8acdd09
BLAKE2b-256 fe50d7adf98388f42e765b963a17081036e9e081e98f665b177f7e8f20f36eff

See more details on using hashes here.

File details

Details for the file cli_pdf-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cli_pdf-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for cli_pdf-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e8478c625357d888182a7474e77b637f0e3683ceb2dfa5395f858dd6a94d527
MD5 416ed79b95bf7a6d80bd2a5a3c477711
BLAKE2b-256 86892d6446d46071a7f23e120416761a82baa4ac71ee05017ed1b98555c1eeae

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