원클릭으로
PDF manipulation - read, merge, split, create PDFs, and extract text or tables.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
PDF manipulation - read, merge, split, create PDFs, and extract text or tables.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Complete guide to using and extending Hermes Agent — CLI usage, setup, configuration, spawning additional agents, gateway platforms, skills, voice, tools, profiles, and a concise contributor reference. Load this skill when helping users configure Hermes, troubleshoot issues, spawn agent instances, or make code contributions.
Create generative and algorithmic art using code - SVG, p5.js, canvas, and procedural techniques.
Create visual art, posters, infographics, and designs as PNG or PDF using HTML/CSS canvas rendering.
Thorough code review with security, performance, correctness, and maintainability checks.
Full workflow - commit changes, push to remote, and create a pull request with description.
Create clean git commits with descriptive messages based on staged or working changes.
| name | |
| description | PDF manipulation - read, merge, split, create PDFs, and extract text or tables. |
| tools | bash, read_file, write_file, terminal |
You are an expert at working with PDF files. You can read, create, merge, split, and extract content from PDFs using Python libraries.
First, ensure required libraries are available:
pip install PyPDF2 pdfplumber reportlab tabulate 2>/dev/null
If pip is not available, try pip3. If running in a restricted environment, check what's already installed:
python -c "import PyPDF2; print('PyPDF2 available')" 2>/dev/null
python -c "import pdfplumber; print('pdfplumber available')" 2>/dev/null
python -c "import reportlab; print('reportlab available')" 2>/dev/null
import pdfplumber
with pdfplumber.open("input.pdf") as pdf:
for i, page in enumerate(pdf.pages):
text = page.extract_text()
print(f"--- Page {i+1} ---")
print(text)
For scanned PDFs (images), you'll need OCR:
pip install pytesseract pdf2image
# Also requires tesseract system package
import pdfplumber
with pdfplumber.open("input.pdf") as pdf:
for page in pdf.pages:
tables = page.extract_tables()
for table in tables:
for row in table:
print(row)
from reportlab.lib.pagesizes import letter
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
from reportlab.lib.units import inch
doc = SimpleDocTemplate("output.pdf", pagesize=letter)
styles = getSampleStyleSheet()
story = []
story.append(Paragraph("Document Title", styles['Title']))
story.append(Spacer(1, 0.3 * inch))
story.append(Paragraph("Body text goes here. ReportLab supports basic HTML-like formatting.", styles['Normal']))
doc.build(story)
from PyPDF2 import PdfMerger
merger = PdfMerger()
merger.append("file1.pdf")
merger.append("file2.pdf")
merger.append("file3.pdf")
merger.write("merged.pdf")
merger.close()
from PyPDF2 import PdfReader, PdfWriter
reader = PdfReader("input.pdf")
# Extract specific pages (0-indexed)
writer = PdfWriter()
writer.add_page(reader.pages[0]) # First page
writer.add_page(reader.pages[2]) # Third page
with open("extracted.pdf", "wb") as f:
writer.write(f)
from PyPDF2 import PdfReader, PdfWriter
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 f:
writer.write(f)
from PyPDF2 import PdfReader, PdfWriter
reader = PdfReader("input.pdf")
writer = PdfWriter()
for page in reader.pages:
page.rotate(90) # 90, 180, or 270 degrees
writer.add_page(page)
with open("rotated.pdf", "wb") as f:
writer.write(f)
from PyPDF2 import PdfReader
reader = PdfReader("input.pdf")
print(f"Pages: {len(reader.pages)}")
meta = reader.metadata
if meta:
print(f"Title: {meta.title}")
print(f"Author: {meta.author}")
print(f"Created: {meta.creation_date}")
pdfplumber generally works better than PyPDF2 for text extractionreportlab is the most capable library