pdf

GitHub

提供基于Python的PDF处理技能,支持读取、创建及修改PDF。涵盖文本/表格提取、页面操作、表单处理、OCR及文档生成,指导使用pypdf、pymupdf和ReportLab等库完成相关任务。

skills/builtin/pdf/1.0.0/SKILL.md simplexai-labs/linger

触发场景

需要读取或解析PDF文件内容 需要合并、拆分或编辑PDF页面 需要从扫描版PDF进行OCR识别 需要生成新的PDF报告或文档

安装

npx skills add simplexai-labs/linger --skill pdf -g -y
更多选项

非标准路径

npx skills add https://github.com/simplexai-labs/linger/tree/main/skills/builtin/pdf/1.0.0 -g -y

不安装直接使用

npx skills use simplexai-labs/linger@pdf

指定 Agent (Claude Code)

npx skills add simplexai-labs/linger --skill pdf -a claude-code -g -y

安装 repo 全部 skill

npx skills add simplexai-labs/linger --all -g -y

预览 repo 内 skill

npx skills add simplexai-labs/linger --list

SKILL.md

Frontmatter
{
    "name": "pdf",
    "description": "Read, create, or change PDF files with Python. Use for text and table extraction, page operations, forms, OCR, or a PDF deliverable."
}

PDF work with Python

Runtime

The active Context has an isolated project in ./agent. Add packages for the operation at hand:

uv --directory ./agent add pypdf
uv --directory ./agent add pymupdf
uv --directory ./agent add reportlab

Use uv --directory ./agent run python ... for scripts. Resolve script, input, and output paths to absolute paths before calling uv, because --directory changes the command's working directory. Write working files to the current Context's ./playground/<scope>/ directory and publish the final PDF through the available delivery tool.

The Runtime normally provides poppler, qpdf, and tesseract in ./agent/conda; use micromamba run --prefix ./agent/conda <command> when one is needed. Add a missing native tool with micromamba install --yes --override-channels --channel conda-forge --prefix ./agent/conda <package>. Do not use apt, pip, conda, or mamba for setup.

Choose the operation

Task Python approach
Merge, split, rotate, watermark, metadata, forms pypdf
Extract positioned text or images; render pages for inspection pymupdf (fitz)
Create a document with flowing text, tables, and page breaks ReportLab Platypus
Draw a fixed page or overlay ReportLab canvas
Scanned pages Render pages, then use Tesseract only for the pages needing OCR

Check whether text extraction works before starting OCR. Preserve source page order, orientation, crop boxes, annotations, and form values unless the task asks to change them. For protected documents, respect the user's access and the PDF's permissions.

Small page operation

from pypdf import PdfReader, PdfWriter

reader = PdfReader("/absolute/path/input.pdf")
writer = PdfWriter()
for page in reader.pages:
    writer.add_page(page)
with open("/absolute/path/output.pdf", "wb") as file:
    writer.write(file)

Use document metadata supplied by the user or derived from the document. Do not insert a vendor name, web address, or promotional metadata.

Check the result

Open the result again with pypdf or pymupdf. Compare page count, page sizes, text or form fields, and metadata with the request. Render and visually inspect every affected page for clipping, missing glyphs, and misplaced overlays. For generated CJK PDFs, register and embed a font that covers the document's characters; verify extracted text as well as the render. If a needed font or renderer is unavailable, describe the remaining check plainly.

版本历史

  • d8ebc34 当前 2026-11-14 00:26

同 Skill 集合

skills/builtin/canvas/1.0.0/SKILL.md
skills/builtin/canvas/1.0.1/SKILL.md
skills/builtin/canvas/1.0.2/SKILL.md
skills/builtin/collaborate/1.0.0/SKILL.md
skills/builtin/create-meeting-minutes/1.0.0/SKILL.md
skills/builtin/docx/1.0.0/SKILL.md
skills/builtin/holistic-context/1.0.0/SKILL.md
skills/builtin/humanlike-browse/1.0.0/SKILL.md
skills/builtin/humanlike-browse/1.0.1/SKILL.md
skills/builtin/humanlike-browse/1.0.2/SKILL.md
skills/builtin/humanlike-browse/1.0.3/SKILL.md
skills/builtin/humanlike-browse/1.0.4/SKILL.md
skills/builtin/humanlike-browse/1.0.8/SKILL.md
skills/builtin/impeccable/1.0.0/SKILL.md
skills/builtin/impeccable/1.0.1/SKILL.md
skills/builtin/lev8-search/1.0.0/SKILL.md
skills/builtin/lev8-search/1.0.1/SKILL.md
skills/builtin/media-generation/1.0.3/SKILL.md
skills/builtin/pptx/1.0.0/SKILL.md
skills/builtin/pptx/1.0.1/SKILL.md
skills/builtin/pptx/1.0.2/SKILL.md
skills/builtin/proactive-response/1.0.0/SKILL.md
skills/builtin/proactive-response/1.0.1/SKILL.md
skills/builtin/skill-installer/1.0.0/SKILL.md
skills/builtin/slide-deck/1.0.0/SKILL.md
skills/builtin/slide-deck/1.0.1/SKILL.md
skills/builtin/superpowers/1.0.0/SKILL.md
skills/builtin/taste/1.0.0/SKILL.md
skills/builtin/taste/1.0.1/SKILL.md
skills/builtin/teamhub-files/1.0.0/SKILL.md
skills/builtin/teamhub-files/1.0.1/SKILL.md
skills/builtin/teamhub-files/1.0.2/SKILL.md
skills/builtin/teamhub-files/1.0.3/SKILL.md
skills/builtin/xlsx/1.0.0/SKILL.md
skills/builtin/artifact/1.0.0/SKILL.md
skills/builtin/artifact/1.0.1/SKILL.md
skills/builtin/artifact/1.0.2/SKILL.md
skills/builtin/chat-card/1.0.0/SKILL.md
skills/builtin/personal-profile/1.0.0/SKILL.md
skills/builtin/personal-profile/1.0.1/SKILL.md
skills/builtin/personal-profile/1.0.2/SKILL.md
skills/builtin/personal-profile/1.0.3/SKILL.md
skills/builtin/personal-profile/1.0.4/SKILL.md
skills/builtin/personal-profile/1.0.5/SKILL.md

元信息

文件数
0
版本
860dbfc
Hash
68f097d5
收录时间
2026-11-14 00:26

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-14 20:39
浙ICP备14020137号-1