记于 丙午年四月十五 15:22

[toc]

### 安装方式

由于你的 Intel Mac (darwin-x64) 没有官方的预编译原生 binary，我通过 **WASM 版本** + 自制 CLI 包装来实现的：

```
💡 litparse 命令已就绪
```

### 使用示例

```bash
# 解析 PDF，输出纯文本
litparse document.pdf --text

# 解析 PDF，输出 JSON（含空间坐标 bounding boxes）
litparse document.pdf --json

# 只解析特定页码
litparse document.pdf --pages 1,3,5 --text

# 查看帮助
litparse --help
```

### JSON 输出包含的结构
- 每页的 `text`、`width`、`height`
- 每个文本元素的 `text`、`x`、`y`、`width`、`height`、`fontName`、`fontSize`（完美保留空间布局信息）

### 注意
- WASM 版本不带内置 OCR 引擎，所以 `ocrEnabled: false`（不影响普通 PDF 解析）
- 如果需要 OCR 功能，可以连接外部 OCR 服务器