pdf

GitHub

提供使用Python处理PDF文件的技能,涵盖合并、拆分、文本提取、表格提取、表单操作、OCR及生成PDF等场景。指导选择pypdf、pymupdf或ReportLab库,并管理依赖与环境。

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

Trigger Scenarios

需要读取或解析PDF内容 需要创建或编辑PDF文档 需要从扫描版PDF中提取文字 需要对PDF进行页面合并或拆分

Install

npx skills add simplexai-labs/linger --skill pdf -g -y
More Options

Non-standard path

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

Use without installing

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.

Version History

  • d8ebc34 Current 2026-11-14 00:26

Same Skill Collection

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

Metadata

Files
0
Version
d8ebc34
Hash
68f097d5
Indexed
2026-11-14 00:26

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-14 07:27
浙ICP备14020137号-1