Skill này làm gì
Công cụ này cho phép bạn làm việc với file PDF. Bạn có thể đọc, gộp, tách, xoay trang, thêm watermark, tạo PDF mới, điền biểu mẫu, mã hóa, giải mã, trích xuất hình ảnh và thậm chí nhận diện chữ trong PDF scan.
Khi nào nên dùng
- ✓Khi bạn cần gộp nhiều tài liệu PDF thành một.
- ✓Khi bạn muốn trích xuất văn bản hoặc bảng từ file PDF.
- ✓Khi bạn cần tạo một PDF mới từ đầu.
Liên kết skill
https://github.com/anthropics/skills/blob/main/skills/pdf/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
📦 Skill này nằm trong các gói sau
Ví dụ cách nhờ AI
“Gộp ba file PDF này thành một.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ dùng thư viện lập trình để xử lý file PDF. Nó có thể đọc nội dung, sắp xếp lại trang, hoặc tạo tài liệu PDF mới theo hướng dẫn của bạn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
PDF Processing Guide
Overview
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
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
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
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
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
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
import pdfplumber
with pdfplumber.open("document.pdf") as pdf:
for page in pdf.pages:
text = page.extract_text()
print(text)
Extract Tables
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
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
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
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)
Subscripts and Superscripts
IMPORTANT: Never use Unicode subscript/superscript characters (₀₁₂₃₄₅₆₇₈₉, ⁰¹²³⁴⁵⁶⁷⁸⁹) in ReportLab PDFs. The built-in fonts do not include these glyphs, causing them to render as solid black boxes.
Instead, use ReportLab's XML markup tags in Paragraph objects:
from reportlab.platypus import Paragraph
from reportlab.lib.styles import getSampleStyleSheet
styles = getSampleStyleSheet()
# Subscripts: use <sub> tag
chemical = Paragraph("H<sub>2</sub>O", styles['Normal'])
# Superscripts: use <super> tag
squared = Paragraph("x<super>2</super> + y<super>2</super>", styles['Normal'])
…
Câu hỏi thường gặp
Làm sao để trích xuất văn bản từ PDF?
Bạn có thể yêu cầu trích xuất văn bản từ PDF, và công cụ sẽ dùng một chương trình để đọc và trình bày nội dung chữ.
Tôi có thể gộp nhiều PDF không?
Có, bạn có thể đưa nhiều file PDF và yêu cầu gộp thành một tài liệu duy nhất.
Nếu PDF là ảnh quét thì sao?
Công cụ có thể dùng nhận dạng ký tự quang học (OCR) để cố gắng đọc chữ trong các PDF về cơ bản là ảnh, như tài liệu quét.
Chi tiết
Mô tả gốc của tác giả
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or
repo: anthropics/skills
Độ phổ biến
- Sao GitHub
- 181k
- Vị trí xếp hạng
- #646
- Giấy phép
- —
- Cập nhật
- 9/10/2026
Bình luận
- …
Thêm skill từ kho mã này
academy-guide
181kGiúp agent gợi ý khóa học và hướng dẫn để học Claude. Hữu ích khi bạn có câu hỏi về cách dùng Claude hoặc các sản phẩm của Claude.
algorithmic-art
181kGiúp agent tạo nghệ thuật bằng code, sinh ra các hình ảnh độc đáo. Hữu ích khi bạn muốn tác phẩm nghệ thuật gốc do máy tính tạo ra.
brand-guidelines
181kGiúp agent áp dụng màu sắc thương hiệu và phong cách hình ảnh của Anthropic vào tài liệu. Hữu ích để giữ bản sắc thị giác nhất quán giữa các dự án.
canvas-design
181kGiúp agent tạo nghệ thuật thị giác đẹp trong các file. Hữu ích khi bạn yêu cầu poster, tác phẩm nghệ thuật hoặc bất kỳ thiết kế tĩnh nào.
Skill tương tự
feishu-doc
394kGiúp agent của bạn đọc, tạo và sửa tài liệu đám mây Feishu, gồm văn bản, hình ảnh và bảng, bằng công cụ tài liệu.
feishu-drive
394kCho phép agent của bạn duyệt, sắp xếp và bình luận các file trong một thư mục đám mây Feishu đã được chia sẻ với bot.
feishu-perm
394kGiúp agent của bạn kiểm tra và thay đổi ai có quyền truy cập một file Feishu, chọn quyền nhỏ nhất đáp ứng yêu cầu của bạn.