Skip to main content

A tool for PDF file manipulation.

Project description

🚀 PdfMod

🌟 Overview

PdfMod is a tool for manipulating PDF files, utilizing the pymupdf library. It enables reading and writing the table of contents, deleting pages, merging PDF files, and extracting pages. PdfMod facilitates the management and modification of PDF files according to your requirements.

📦 Dependencies

[!NOTE] PdfMod requires Python 3.7 or higher.

💻 Installation

To install PdfMod, run the following command in your terminal:

pip install pdfmod

🚀 Basic Usage

Reading a PDF's Table of Contents

To read a PDF file's table of contents and open it in a text editor, use the following command:

pdfmod toc read "D:\\如何提问.pdf" notepad

This command will extract the table of contents from the PDF file and open it in Notepad.

Writing to a PDF's Table of Contents

To write a table of contents to a PDF file, use the following command:

pdfmod toc write "D:\\如何提问.pdf" --bias=8

This command will write the table of contents to the PDF file with a bias of 8.

The --bias option is used to adjust the position of the table of contents within the PDF file. A bias of 8 means that the table of contents will be shifted 8 units to the right from its default position. This can be useful for aligning the table of contents with the content of the PDF file.

Deleting Pages from a PDF

To delete pages from a PDF file, use the following command:

pdfmod delete "D:\\如何提问.pdf" 0 25

This command will delete pages 0 through 25 from the PDF file.

Joining PDF Files

To merge two PDF files, use the following command:

pdfmod join "D:\\如何提问_上半.pdf" "D:\\如何提问_下半.pdf"

This command will merge the two PDF files into a single PDF file.

Extracting Pages from a PDF

To extract pages from a PDF file and save them as a new PDF, use the following command:

pdfmod extract "D:\\如何提问.pdf" 0 25

This command will extract pages 0 through 25 from the PDF file and save them as a new PDF file.

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

pdfmod-0.1.5.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

pdfmod-0.1.5-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file pdfmod-0.1.5.tar.gz.

File metadata

  • Download URL: pdfmod-0.1.5.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pdfmod-0.1.5.tar.gz
Algorithm Hash digest
SHA256 59acd14d0a9ac8e3a0a17112118b5bc006d25d5604125fe81bf81c76406db463
MD5 67453e7127b0764c29a43fc1b8f036c2
BLAKE2b-256 a4f672e0dc293b8dcff8e1e15826767628068059c95bdc4e36ceb09c77413a87

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdfmod-0.1.5.tar.gz:

Publisher: ci-cd.yml on aoout/PdfMod

Attestations:

File details

Details for the file pdfmod-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pdfmod-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pdfmod-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7ab9fc589bf2d64c4e7fd9c03d9eac08199bcce06cde4a7436c92e7e0ee25bcc
MD5 d9664799a2c9a5eadfa4ecd2eaebbc95
BLAKE2b-256 5de23d01a33898ff9b38e2bd9b1050734493410395a7134b76c6fe609a0153f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdfmod-0.1.5-py3-none-any.whl:

Publisher: ci-cd.yml on aoout/PdfMod

Attestations:

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