Metadata-Version: 2.4
Name: xl-pdf
Version: 0.1.1
Summary: PDF stamp and manipulation utilities using PyMuPDF
Project-URL: Homepage, https://github.com/xilong/py-pdf
Project-URL: Bug Tracker, https://github.com/xilong/py-pdf/issues
Author-email: xilong <xilong_tech@163.com>
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Requires-Dist: pillow==9.5.0
Requires-Dist: pymupdf==1.26.6
Requires-Dist: qrcode==8.2
Description-Content-Type: text/markdown

# xl-pdf

PDF stamp and manipulation utilities using PyMuPDF.

## Installation

```bash
pip install xl-pdf
```

## Usage

```python
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

