Pdf logo

Pdf

Community
wulaosiji
pdf

PDF文件处理全能工具,支持PDF创建、合并、拆分、文本提取、表格提取、OCR识别、加密解密、添加水印、图片提取和表单填写。 Use when: "提取PDF文字", "合并PDF文件", "拆分PDF", "extract PDF text", "merge PDF files", "PDF加水印", "OCR scanned PDF", "PDF转Word". 整合pypdf、pdfplumber、reportlab、qpdf等工具,覆盖PDF全生命周期操作。Cross-references: document-hub, content-extractor, email-sender. Built by UniqueClub 🌐 https://uniqueclub.ai

Overview

Publisherwulaosiji
Repositoryskills
Skill namepdf
Stars
28
Forks
11
Bundled files
10
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 10 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wulaosiji on GitHub. Read the source before you install it.

Installation

Install the Pdf AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wulaosiji/skills/tree/main/pdf
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wulaosiji/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/pdf .claude/skills/pdf
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Pdf in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Pdf on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Pdf is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

PDF Processing Guide

Comprehensive PDF processing operations using Python libraries and command-line tools.

When to Use

Use this skill when:

  • 需要提取PDF中的文本或表格数据
  • 合并多个PDF文件为一个
  • 将PDF拆分为单页文件
  • 旋转PDF页面方向
  • 为PDF添加水印
  • 创建新的PDF文档
  • 处理PDF表单填写
  • 对PDF进行加密或解密
  • OCR识别扫描版PDF
  • 从PDF中提取图片

Do NOT use this skill if:

  • PDF文件被密码保护且无密码 → 需获取密码后使用
  • 需要复杂的PDF编辑(如修改现有内容)→ 使用专业PDF编辑器
  • PDF文件损坏无法读取 → 先修复文件
  • 需要保留原始PDF的复杂排版 → 提取内容可能丢失格式

Typical triggers:

  • 「提取PDF文字」「合并PDF文件」「拆分PDF」
  • "Extract PDF text", "Merge PDF files", "Split PDF"
  • 「PDF加水印」「PDF转Word」「扫描PDF识别」
  • "Add watermark to PDF", "Convert PDF to Word", "OCR scanned PDF"

Workflow

遵循六步推进法(探查→约束→证据→执行→验证→交付)完成操作。

  1. 探查 (Probe) 完整读取用户需求,确认PDF操作类型和输入文件。检查PDF是否可读、是否加密、页数。

  2. 约束 (Constrain) 根据操作类型选择合适工具,设定边界和不可降级的交付标准。受阻时换通道,不降级交付物。

操作类型推荐工具复杂度
文本提取pdfplumber简单
表格提取pdfplumber中等
合并/拆分pypdf / qpdf简单
创建PDFreportlab中等
OCR识别pytesseract复杂
  1. 证据 (Evidence) 提取的文本和表格数据必须来自PDF实际内容,不编造数据。每个数字必须可追溯到PDF原文页码。

  2. 执行 (Execute) 调用对应工具执行操作,先给影响与结论,再给行动和必要证据。

python
from pypdf import PdfReader, PdfWriter
# 或
import pdfplumber
  1. 验证 (Verify) 用不同于生成路径的方式回读输出——检查输出文件完整性,验证提取的文本/数据准确性,确认格式保持正确。大型PDF分页验证。

  2. 交付 (Deliver) 返回处理结果(文件路径或提取数据),清理临时文件。

Output

  • 文本提取:返回纯文本字符串
  • 表格提取:返回 List[List[str]] 或 pandas DataFrame
  • 合并/拆分/旋转/水印:返回输出PDF文件路径
  • 创建PDF:返回生成的PDF文件路径
  • OCR:返回识别后的文本字符串

Guardrails

以下约束确保安全、可靠地使用本技能。

Anti-patterns

  • NEVER 使用Unicode上下标字符(会导致黑框),使用 <sub> 和 <super> 标签
  • Do NOT 不验证提取的表格数据
  • Do NOT 忽略PDF版本兼容性问题
  • Do NOT 处理大型PDF时不分页处理

Constraints

  • 扫描版PDF需要OCR才能提取文本
  • 复杂排版可能丢失格式
  • 某些PDF字体嵌入问题
  • 加密PDF需要密码

Important Notes

  1. Subscripts/Superscripts: 使用 <sub> 和 <super> 标签,不要用Unicode字符
  2. Table Extraction: 复杂表格可能需要手动调整
  3. OCR Quality: 依赖图片清晰度

Quick Start

python
from pypdf import PdfReader, PdfWriter

# Read a PDF
reader = PdfReader("document.pdf")
print(f"Pages: {len(reader.pages)}")

# Extract text
text = ""
for page in reader.pages:
    text += page.extract_text()

Python Libraries

pypdf - Basic Operations

Merge PDFs
python
from pypdf import PdfWriter, PdfReader

writer = PdfWriter()
for pdf_file in ["doc1.pdf", "doc2.pdf", "doc3.pdf"]:
    reader = PdfReader(pdf_file)
    for page in reader.pages:
        writer.add_page(page)

with open("merged.pdf", "wb") as output:
    writer.write(output)
Split PDF
python
reader = PdfReader("input.pdf")
for i, page in enumerate(reader.pages):
    writer = PdfWriter()
    writer.add_page(page)
    with open(f"page_{i+1}.pdf", "wb") as output:
        writer.write(output)
Extract Metadata
python
reader = PdfReader("document.pdf")
meta = reader.metadata
print(f"Title: {meta.title}")
print(f"Author: {meta.author}")
Rotate Pages
python
reader = PdfReader("input.pdf")
writer = PdfWriter()

page = reader.pages[0]
page.rotate(90)  # Rotate 90 degrees clockwise
writer.add_page(page)

with open("rotated.pdf", "wb") as output:
    writer.write(output)

pdfplumber - Text and Table Extraction

Extract Text with Layout
python
import pdfplumber

with pdfplumber.open("document.pdf") as pdf:
    for page in pdf.pages:
        text = page.extract_text()
        print(text)
Extract Tables
python
with pdfplumber.open("document.pdf") as pdf:
    for i, page in enumerate(pdf.pages):
        tables = page.extract_tables()
        for j, table in enumerate(tables):
            print(f"Table {j+1} on page {i+1}:")
            for row in table:
                print(row)
Advanced Table Extraction
python
import pandas as pd

with pdfplumber.open("document.pdf") as pdf:
    all_tables = []
    for page in pdf.pages:
        tables = page.extract_tables()
        for table in tables:
            if table:
                df = pd.DataFrame(table[1:], columns=table[0])
                all_tables.append(df)

if all_tables:
    combined_df = pd.concat(all_tables, ignore_index=True)
    combined_df.to_excel("extracted_tables.xlsx", index=False)

reportlab - Create PDFs

Basic PDF Creation
python
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas

c = canvas.Canvas("hello.pdf", pagesize=letter)
width, height = letter

c.drawString(100, height - 100, "Hello World!")
c.line(100, height - 140, 400, height - 140)

c.save()
Multi-Page PDF
python
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak
from reportlab.lib.styles import getSampleStyleSheet

doc = SimpleDocTemplate("report.pdf", pagesize=letter)
styles = getSampleStyleSheet()
story = []

story.append(Paragraph("Report Title", styles['Title']))
story.append(Spacer(1, 12))
story.append(Paragraph("Body content", styles['Normal']))
story.append(PageBreak())
story.append(Paragraph("Page 2", styles['Heading1']))

doc.build(story)
Subscripts and Superscripts

IMPORTANT: Never use Unicode subscript/superscript characters. Use ReportLab's XML markup:

python
from reportlab.platypus import Paragraph

# Subscripts: use <sub> tag
chemical = Paragraph("H<sub>2</sub>O", styles['Normal'])

# Superscripts: use <super> tag  
squared = Paragraph("x<super>2</super>", styles['Normal'])

Command-Line Tools

pdftotext (poppler-utils)

bash
# Extract text
pdftotext input.pdf output.txt

# Preserve layout
pdftotext -layout input.pdf output.txt

# Specific pages
pdftotext -f 1 -l 5 input.pdf output.txt  # Pages 1-5

qpdf

bash
# Merge PDFs
qpdf --empty --pages file1.pdf file2.pdf -- merged.pdf

# Split pages
qpdf input.pdf --pages . 1-5 -- pages1-5.pdf

# Rotate pages
qpdf input.pdf output.pdf --rotate=+90:1

# Remove password
qpdf --password=mypassword --decrypt encrypted.pdf decrypted.pdf

Common Tasks

OCR on Scanned PDFs

python
import pytesseract
from pdf2image import convert_from_path

images = convert_from_path('scanned.pdf')
text = ""
for i, image in enumerate(images):
    text += f"Page {i+1}:\n"
    text += pytesseract.image_to_string(image)
    text += "\n\n"

Add Watermark

python
from pypdf import PdfReader, PdfWriter

watermark = PdfReader("watermark.pdf").pages[0]
reader = PdfReader("document.pdf")
writer = PdfWriter()

for page in reader.pages:
    page.merge_page(watermark)
    writer.add_page(page)

with open("watermarked.pdf", "wb") as output:
    writer.write(output)

Extract Images

bash
pdfimages -j input.pdf output_prefix

Password Protection

python
from pypdf import PdfReader, PdfWriter

reader = PdfReader("input.pdf")
writer = PdfWriter()

for page in reader.pages:
    writer.add_page(page)

writer.encrypt("userpassword", "ownerpassword")

with open("encrypted.pdf", "wb") as output:
    writer.write(output)

Quick Reference

TaskBest ToolCommand/Code
Merge PDFspypdfwriter.add_page(page)
Split PDFspypdfOne page per file
Extract textpdfplumberpage.extract_text()
Extract tablespdfplumberpage.extract_tables()
Create PDFsreportlabCanvas or Platypus
Command line mergeqpdfqpdf --empty --pages ...
OCR scanned PDFspytesseractConvert to image first

Related Skills

  • document-hub — 上级封装:Word/Excel与PDF互转的统一入口
  • content-extractor — 内容来源:提取网络内容生成PDF
  • email-sender — 下游分发:发送PDF附件

About UniqueClub

Part of the UniqueClub toolkit — a collection of skills for AI-powered content creation and automation. 🌐 https://uniqueclub.ai

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Pdf AI skill do?

PDF文件处理全能工具,支持PDF创建、合并、拆分、文本提取、表格提取、OCR识别、加密解密、添加水印、图片提取和表单填写。 Use when: "提取PDF文字", "合并PDF文件", "拆分PDF", "extract PDF text", "merge PDF files", "PDF加水印", "OCR scanned PDF", "PDF转Word". 整合pypdf、pdfplumber、reportlab、qpdf等工具,覆盖PDF全生命周期操作。Cross-references: document-hub, content-extractor, email-sender. Built by UniqueClub 🌐 https://uniqueclub.ai

Why use Pdf on TypingMind?

Because you install it once and use it with any model. Pdf is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Pdf in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wulaosiji/skills/tree/main/pdf. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Pdf?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Pdf?

As many as you like. As long as a model supports skills, you can use Pdf with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Pdf AI skill free?

It is published on GitHub by wulaosiji. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇