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.0.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.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xl_pdf-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 90e17e358d9b944d7fa35d8d5a7f69065aad1fe4b9f4aa0532f670835dbf29ee
MD5 d98b21732d44038e931ed8e70e852ec2
BLAKE2b-256 7eb5ca26678cf5f2cccd94718dc556061019f9e37e0f3cf7121a2c0ae1005f0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xl_pdf-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 675169696a05f8842e8d67338054711fdd91dabebaaf44f41df48be46a556d43
MD5 60b5e48f5007c0bd829c5691792cc738
BLAKE2b-256 af0e268d2e3dd32262fa7a40cdffb1b43f5fbd8cc424a0edb8cd2fb9cbfe3829

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