Skip to main content

PDF stamp and manipulation utilities using PyMuPDF

Project description

xl-pdf

PDF stamp and manipulation utilities using PyMuPDF.

Installation

pip install xl-pdf

Usage

from xl_pdf import PDFStampAdder

# 从文件路径或bytes创建PDFStampAdder
adder = PDFStampAdder("input.pdf")
# 或
adder = PDFStampAdder(pdf_bytes)

# 添加印章
adder.add_stamp_to_pdf("stamp.png", scale_height=50, page_num=0, x=100, y=100)

# 添加文字
adder.add_text_to_pdf("Hello World", page_num=0, x=100, y=200, font_size=20)

# 添加二维码
adder.add_qrcode_to_pdf("https://example.com", size=100, page_num=0, x=100, y=300)

# 保存PDF
adder.save("output.pdf")
# 或获取bytes
pdf_bytes = adder.bytes

Features

  • Add stamps to PDF pages
  • Add text to PDF pages
  • Add QR codes to PDF pages
  • Add cross-page stamps (骑缝章)
  • Search and add stamps/text around specific text
  • Compress images automatically
  • Export to file or bytes

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

xl_pdf-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

xl_pdf-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file xl_pdf-0.1.1.tar.gz.

File metadata

  • Download URL: xl_pdf-0.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for xl_pdf-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9afcea3f495818c8ea2124fe9d7b02f59bfc688903293e96e2d3e89ab38d7367
MD5 8fe39c75ae809e726c17008aa730b766
BLAKE2b-256 fe8ea0950ab61d45c56bcb47f7e0d6810b9091a82a31c06872010ad53d582634

See more details on using hashes here.

File details

Details for the file xl_pdf-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xl_pdf-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for xl_pdf-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0fd8557c154121b91fbd860e92cda054faecb8b158ca2f11c3da97bb6b6e842d
MD5 52147ff624e8407af916706f3e1011cd
BLAKE2b-256 bbd940df344ac9a9a372e59531cbd91f3aef58464a8840090e5d8f7533682188

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