| name | pdf |
| description | 使用本地开源工具创建、检查、提取、合并、拆分、旋转、渲染与校验 PDF 文件。当需求涉及 PDF 输入或输出、页面级转换、文本或表格提取,或需要对生成的 PDF 做视觉核验时使用。 |
PDF
Use the deterministic PDF CLI for common creation and transformation tasks. Preserve source files and write transformed PDFs to new paths.
Runtime
Prefer workspace dependency Python. Otherwise use Python 3:
python3 "$SKILL_DIR/scripts/bootstrap.py" <command> [arguments]
Missing packages are installed from the hashed lock into ~/.wegent-executor/plugin-envs/wework-public/pdf/, never globally.
Workflow
- Run
inspect --text or extract to understand an input PDF.
- For new PDFs, author a JSON specification following spec.md, then run
create.
- Use
merge, split, or rotate for page-level transformations.
- Run
validate on the final PDF.
- Run
render and inspect every output page image before delivery when layout matters.
Commands
python3 "$SKILL_DIR/scripts/bootstrap.py" inspect --input source.pdf --text --output inspection.json
python3 "$SKILL_DIR/scripts/bootstrap.py" extract --input source.pdf --tables --output extraction.json
python3 "$SKILL_DIR/scripts/bootstrap.py" create --spec report.json --output report.pdf
python3 "$SKILL_DIR/scripts/bootstrap.py" merge --inputs first.pdf second.pdf --output merged.pdf
python3 "$SKILL_DIR/scripts/bootstrap.py" split --input merged.pdf --pages '1-3,5' --output selection.pdf
python3 "$SKILL_DIR/scripts/bootstrap.py" rotate --input source.pdf --degrees 90 --pages '2' --output rotated.pdf
python3 "$SKILL_DIR/scripts/bootstrap.py" validate --input result.pdf
python3 "$SKILL_DIR/scripts/bootstrap.py" render --input result.pdf --output-dir rendered
Quality rules
- Do not overwrite input PDFs.
- Preserve page order intentionally and use 1-based page selections.
- Treat extracted text as an interpretation of PDF drawing instructions; verify tables and reading order against rendered pages.
- Warn when a PDF is encrypted or content extraction is incomplete.
- A structurally valid PDF still requires visual inspection when it is user-facing.