# 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

