awspace

Pdf

知識管理v0.1.0
作者:awspace更新於 2026-09-16pdf
#PDF

據 AlphaMoat 統計,截至 2026-10,Pdf 累計下載 51,618 次、獲 66 個星標,按累計下載量在本次參與排名的 10,914 個 AI 技能中排名第 478 位,在「知識管理」分類(745 個)中排名第 35 位。

列表預設按累計下載量排序,也可按星標排序;詳情頁排名按累計下載量計算。

累計下載
5.2萬
星標
66
全站下載量排名
#478
全站前 5% · 「知識管理」前 5%
平台累計下載星標評論
ClawHub ↗5.2萬661

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

覆蓋從 PDF 抽取文字與表格、新建文件、合併或拆分檔案,以及表單處理;更高階的用法與 JavaScript 庫見 reference.md,填表單按 forms.md 的說明操作。

資料釋出於 2026-10-27

可以用來做什麼

  • 把合同 PDF 裡的文字和表格抽出來核對
  • 把多份 PDF 合併後再按章節拆開

什麼時候用

  • 需要從 PDF 裡取表格資料時
  • 需要合併或拆分多份 PDF 時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

把這份 PDF 的表格抽成結構化資料
把這幾個 PDF 合併,再按章節拆開

月度資料趨勢

累計下載5.2萬
4.7萬5.1萬5.4萬2026-05 · 累計下載 4.8萬2026-06 · 累計下載 5.4萬2026-07 · 累計下載 4.7萬2026-08 · 累計下載 4.8萬2026-09 · 累計下載 5萬2026-10 · 累計下載 5.2萬26-0526-0926-10
星標66
62831032026-05 · 星標 842026-06 · 星標 1002026-07 · 星標 652026-08 · 星標 652026-09 · 星標 662026-10 · 星標 6626-0526-0926-10

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。 該技能有同名的其他版本,調整前的資料歸屬當前下載量最大的這一個。

月份累計下載環比星標
2026-105.2萬—66
2026-095萬—66
2026-084.8萬+2.2%65
2026-074.7萬-12.1%65
2026-065.4萬+12.7%100
2026-054.8萬—84

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

6.9 KB · ClawHub v0.1.0
---
name: pdf
description: Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
license: Proprietary. LICENSE.txt has complete terms
---

# PDF Processing Guide

## Overview
展開全部(共 295 行)
This guide covers essential PDF processing operations using Python libraries and command-line tools. For advanced features, JavaScript libraries, and detailed examples, see reference.md. If you need to fill out a PDF form, read forms.md and follow its instructions.

## 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}")
print(f"Subject: {meta.subject}")
print(f"Creator: {meta.creator}")
```

#### 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:  # Check if table is not empty
                df = pd.DataFrame(table[1:], columns=table[0])
                all_tables.append(df)

# Combine all tables
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

# Add text
c.drawString(100, height - 100, "Hello World!")
c.drawString(100, height - 120, "This is a PDF created with reportlab")

# Add a line
c.line(100, height - 140, 400, height - 140)

# Save
c.save()
```

#### Create PDF with Multiple Pages
```python
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak
from reportlab.lib.styles import getSampleStyleSheet

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

# Add content
title = Paragraph("Report Title", styles['Title'])
story.append(title)
story.append(Spacer(1, 12))

body = Paragraph("This is the body of the report. " * 20, styles['Normal'])
story.append(body)
story.append(PageBreak())

# Page 2
story.append(Paragraph("Page 2", styles['Heading1']))
story.append(Paragraph("Content for page 2", styles['Normal']))

# Build PDF
doc.build(story)
```

## Command-Line Tools

### pdftotext (poppler-utils)
```bash
# Extract text
pdftotext input.pdf output.txt

# Extract text preserving layout
pdftotext -layout input.pdf output.txt

# Extract 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
qpdf input.pdf --pages . 6-10 -- pages6-10.pdf

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

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

### pdftk (if available)
```bash
# Merge
pdftk file1.pdf file2.pdf cat output merged.pdf

# Split
pdftk input.pdf burst

# Rotate
pdftk input.pdf rotate 1east output rotated.pdf
```

## Common Tasks

### Extract Text from Scanned PDFs
```python
# Requires: pip install pytesseract pdf2image
import pytesseract
from pdf2image import convert_from_path

# Convert PDF to images
images = convert_from_path('scanned.pdf')

# OCR each page
text = ""
for i, image in enumerate(images):
    text += f"Page {i+1}:\n"
    text += pytesseract.image_to_string(image)
    text += "\n\n"

print(text)
```

### Add Watermark
```python
from pypdf import PdfReader, PdfWriter

# Create watermark (or load existing)
watermark = PdfReader("watermark.pdf").pages[0]

# Apply to all pages
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
# Using pdfimages (poppler-utils)
pdfimages -j input.pdf output_prefix

# This extracts all images as output_prefix-000.jpg, output_prefix-001.jpg, etc.
```

### Password Protection
```python
from pypdf import PdfReader, PdfWriter

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

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

# Add password
writer.encrypt("userpassword", "ownerpassword")

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

## Quick Reference

| Task | Best Tool | Command/Code |
|------|-----------|--------------|
| Merge PDFs | pypdf | `writer.add_page(page)` |
| Split PDFs | pypdf | One page per file |
| Extract text | pdfplumber | `page.extract_text()` |
| Extract tables | pdfplumber | `page.extract_tables()` |
| Create PDFs | reportlab | Canvas or Platypus |
| Command line merge | qpdf | `qpdf --empty --pages ...` |
| OCR scanned PDFs | pytesseract | Convert to image first |
| Fill PDF forms | pdf-lib or pypdf (see forms.md) | See forms.md |

## Next Steps

- For advanced pypdfium2 usage, see reference.md
- For JavaScript libraries (pdf-lib), see reference.md
- If you need to fill out a PDF form, follow the instructions in forms.md
- For troubleshooting guides, see reference.md

「知識管理」分類下的熱門技能

搜尋引擎知識管理

透過公開搜尋URL在16個搜尋引擎(7個國內直連+9個國際)中做跨引擎檢索、結果去重與多源交叉驗證,無需API Key,內建零依賴Python指令碼。Use when 使用者要求“搜一下/查資料/多找幾個來源/核實訊息/找公眾號文章/排查報錯/找論文或開源專案”時。輸入自然語言查詢詞,輸出帶來源連結與可信度標註的結構化結果。不適用於私有資料檢索、批次抓取、需要登入後可見的內容。

↓ 1075.9萬★ 147u_8ee34d77
ima-skills知識管理

透過 IMA OpenAPI 管理筆記與知識庫內容。

↓ 108.4萬★ 566u_1742680f
Summarize知識管理

把長文字、文件與網頁內容壓縮成要點和關鍵詞的摘要工具。

↓ 87.6萬★ 1048paudyyin
全網搜尋知識管理

透過“查一下、搜一下、搜尋、找一下”等自然語言檢索公開網頁,整理來源並交付橫版 PDF、Markdown 與標題連結表。支援使用者主動開啟、檢視和取消技能收藏,保留原報告取回。

↓ 50.9萬★ 2u_32d99f8a
web-tools-guide知識管理

規定如何為網頁請求選擇合適工具的必讀指引。

↓ 40萬★ 220user_ec205dbb
Aihot Skill Lite知識管理

AI HOT(aihot.virxact.com)中文 AI 資訊查詢 Skill,幫助使用者獲取今日 AI 圈動態、AI 日報、AI 熱點、最新 AI 資訊以及 OpenAI、Anthropic、Google 等公司的最新發布資訊。

↓ 32.1萬★ 92Khazix
全球12億文獻知識庫(8千萬中文期刊可下載)知識管理

全球12億文獻知識庫(8千萬中文期刊可下載)——透過 SmartLib 開放平台 API 提供中外文學術文獻檢索與下載能力,覆蓋 8000 萬篇授權中文期刊全文 + 12.28 億條全球文獻後設資料(期刊 7.19 億 / 專利 2.15 億 / 會議 7155 萬 / 學位論文 2473 萬 / 標準 268 萬)。 能力:中英文關鍵詞檢索、文獻詳情、中文期刊 PDF 全文下載、外文 OA 文獻十級渠道免費下載(不消耗配額)、智慧關鍵詞擴充套件、核心期刊優先排序、相關性重排、引文追溯、分類號檢索。 配額:首次使用自動註冊,免費 100 次檢索 + 10 次下載 / 月;耗盡自動彈出方案(體驗卡 / 個人版月 / 專業版月 / 單篇下載 / 下載包),可說「升級 / 充值」喚起;企業 / 機構定製聯絡 [email protected]。 觸發:使用者表達"查論文""找文獻""檢索學術""搜期刊""查專利""找標準""下論文""寫文獻綜述""找參考文獻""查 SCI/EI"等意圖時啟用;也適用"幫我找關於 XX 的論文""寫文獻綜述""找幾篇引用支撐論點"。英文:"find papers" "search literature" "write literature review" "find supporting citations"。 呼叫前必須先用 /consume 獲取 consume_token,再憑 token 調 /search(每次計費介面呼叫都需一次 /consume)。

↓ 30.3萬★ 189user_164f4c1f
Markdown Converter知識管理

用 uvx 直接呼叫 markitdown,把各類檔案轉成 Markdown。

↓ 20.4萬★ 256Peter Steinberger

awspace 的其他技能

資料月份:2026-10 · 下載/星標數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。