Skills2026年3月29日·1 分钟阅读

Claude Official Skill: PDF — Read, Create & Edit PDFs

Claude Code skill for PDF files. Read content, extract data, create new PDFs, merge documents, and convert formats. Activates automatically.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 66/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Community
入口
Claude Official Skill: pdf
先审查命令
npx -y tokrepo@latest install 8341096b-7590-4442-89c1-431ce880d106 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
Official Claude Code skill that reads, creates, merges, and converts PDF files automatically.
§01

What it is

This is an official Claude Code skill from Anthropic's skills repository for working with PDF files. It handles reading content, extracting text and tables, creating new PDFs, merging multiple documents, splitting pages, and converting between formats.

The skill is designed for developers and knowledge workers who use Claude Code to process PDF documents without switching to external tools or writing custom extraction code.

§02

How it saves time or tokens

The skill activates automatically when you ask Claude Code to work with PDF files. Instead of researching which Python library to use (PyPDF2, pdfplumber, reportlab, pypdf), the skill provides Claude Code with the right approach for each task. The estimated token cost is around 500 tokens per invocation.

§03

How to use

  1. Install via Claude Code:
claude skill install anthropics/skills/pdf
  1. Or manually copy the SKILL.md content to .claude/skills/pdf/SKILL.md
  2. Ask Claude Code to work with any PDF file in your project
§04

Example

# Extract text from a PDF (generated by Claude Code with pdf skill)
import pdfplumber

def extract_tables(pdf_path):
    tables = []
    with pdfplumber.open(pdf_path) as pdf:
        for page in pdf.pages:
            page_tables = page.extract_tables()
            for table in page_tables:
                tables.append(table)
    return tables

# Create a new PDF with reportlab
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas

def create_report(output_path, title, content):
    c = canvas.Canvas(output_path, pagesize=letter)
    c.setFont('Helvetica-Bold', 16)
    c.drawString(72, 750, title)
    c.setFont('Helvetica', 12)
    y = 720
    for line in content.split('\n'):
        c.drawString(72, y, line)
        y -= 15
    c.save()
§05

Related on TokRepo

§06

Common pitfalls

  • Using PyPDF2 for text extraction when pdfplumber gives better results for complex layouts
  • Not handling password-protected PDFs, which require the password parameter in open calls
  • Attempting to extract text from scanned PDFs without OCR (use pytesseract for those cases)

常见问题

What PDF operations does this skill handle?+

The skill handles reading text and tables, creating new PDFs, merging multiple files, splitting by page ranges, converting to and from other formats, adding watermarks, and extracting embedded images.

Does the skill work with scanned PDFs?+

For scanned PDFs (image-only), the skill guides Claude Code to use OCR tools like pytesseract. Standard text-based PDFs are processed directly with pdfplumber or pypdf.

Which Python libraries does the skill use?+

The skill chooses the right library for each task: pdfplumber for text and table extraction, reportlab for PDF creation, pypdf for merging and splitting, and pikepdf for low-level PDF manipulation.

Can I process password-protected PDFs?+

Yes. The skill handles encrypted PDFs by passing the password parameter to the PDF library. You provide the password in your prompt, and Claude Code uses it to unlock the file.

Is this skill maintained by Anthropic?+

Yes. This is an official skill from Anthropic's skills repository, maintained by the Claude Code team. It follows the standard skill format and receives updates alongside Claude Code.

引用来源 (3)
🙏

来源与感谢

Created by Anthropic. Licensed under MIT. anthropics/skills

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产