一键导入
PDF manipulation tasks such as reading text, extracting metadata, merging, splitting, and rotating pages using the Python pypdf library.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
PDF manipulation tasks such as reading text, extracting metadata, merging, splitting, and rotating pages using the Python pypdf library.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Manage Git repositories within the workspace. Check status, commit changes, view diffs, and create branches.
Create, modify, and analyze PowerPoint presentations (.pptx) using standard Python libraries.
Create animated GIFs optimized for Slack (small file size, loop, transparency) using Python libraries like imageio and Pillow.
Generate structured JSON theme configurations for UI components, presentations, or documents. Supports color palettes, typography, and spacing.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends AI capabilities with specialized knowledge, workflows, or tool integrations.
Suite of tools for creating elaborate, multi-component AnyCowork HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
| name | |
| description | PDF manipulation tasks such as reading text, extracting metadata, merging, splitting, and rotating pages using the Python pypdf library. |
| license | Apache 2.0 |
This skill allows you to perform various operations on PDF files using the pypdf library in Python.
This skill relies on the pypdf library and its dependencies.
pip install pypdf
To read text from a PDF file:
from pypdf import PdfReader
reader = PdfReader("example.pdf")
number_of_pages = len(reader.pages)
page = reader.pages[0]
text = page.extract_text()
print(text)
To merge multiple PDFs into a single file:
from pypdf import PdfWriter
merger = PdfWriter()
for pdf in ["file1.pdf", "file2.pdf", "file3.pdf"]:
merger.append(pdf)
merger.write("merged-pdf.pdf")
merger.close()
To extract specific pages (e.g., pages 1 and 3 - 0-indexed) into a new file:
from pypdf import PdfReader, PdfWriter
reader = PdfReader("source.pdf")
writer = PdfWriter()
# Add page 1 (index 0) and page 3 (index 2)
writer.add_page(reader.pages[0])
writer.add_page(reader.pages[2])
with open("extracted_pages.pdf", "wb") as f:
writer.write(f)
To access PDF metadata:
from pypdf import PdfReader
reader = PdfReader("example.pdf")
meta = reader.metadata
print(f"Title: {meta.title}")
print(f"Author: {meta.author}")
print(f"Producer: {meta.producer}")
FileNotFoundError or encrypted/corrupted PDFs.pypdf can handle encrypted PDFs if the password is known using reader.decrypt('password').