Qué hace
Enseña a tu agente a trabajar con archivos PDF, como leer su texto, combinarlos o dividirlos, y crear otros nuevos. Está pensada para cualquiera que necesite manejar PDF sin hacerlo a mano.
Cuándo usarla
- ✓Cuando subes un PDF y quieres extraer su texto o sus tablas.
- ✓Cuando quieres combinar, dividir, girar o añadir una marca de agua a páginas PDF.
- ✓Cuando necesitas crear un PDF nuevo o rellenar un formulario PDF.
Link de la skill
https://github.com/HKUDS/DeepTutor/blob/main/deeptutor/skills/builtin/pdf/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“¿Puedes extraer las tablas de este PDF y ponerlas en una lista?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente usa herramientas de Python ya preparadas que pueden leer y cambiar archivos PDF. Ejecuta el trabajo en un entorno aislado y después devuelve el archivo terminado.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Work PDFs in the sandbox with preinstalled Python libs. Pick the library by task:
- Extract text/tables/layout/word-coordinates →
pdfplumber; quick raw text or page ops →pypdf. - Merge / split / rotate / crop / watermark / encrypt / metadata →
pypdf. - Fill forms →
pypdf(fillable AcroForm fields) or annotation overlay (flat forms). - Create from scratch →
reportlab.
Use exec with complete Python source (language: python). Prefer creating,
reopening, and validating the PDF in one call; later calls can revise the same
relative filename. Follow the turn's User workspace instructions for
locating inputs, output boundaries, and presenting the finished file.
Preserve an explicitly requested quantity (such as 500 words) and verify the count in the output before finishing. If execution fails or the artifact is missing, diagnose stderr/root cause and change strategy; do not retry identical code or reduce the requested scope without asking.
Extract text and tables (pdfplumber)
import pdfplumber
with pdfplumber.open("in.pdf") as pdf:
for i, page in enumerate(pdf.pages, 1):
print(f"--- page {i} ---")
print(page.extract_text() or "") # layout-aware text
for t in page.extract_tables(): # list of tables; each is list[row]
for row in t:
print(row)
Tables → Excel (one worksheet per table):
import pdfplumber
from openpyxl import Workbook
workbook = Workbook()
workbook.remove(workbook.active)
table_number = 0
with pdfplumber.open("in.pdf") as pdf:
for page_number, page in enumerate(pdf.pages, 1):
for table in page.extract_tables():
if not table:
continue
table_number += 1
sheet = workbook.create_sheet(f"p{page_number}_table{table_number}"[:31])
for row in table:
sheet.append([cell or "" for cell in row])
if table_number:
workbook.save("tables.xlsx")
Messy tables: pass strategies, or crop a region with page.within_bbox((x0, top, x1, bottom)) first:
ts = {
"vertical_strategy": "lines",
"horizontal_strategy": "lines",
"snap_tolerance": 3,
"intersection_tolerance": 15,
}
page.extract_tables(ts)
For very large PDFs where you only need raw text, pypdf's page.extract_text() is lighter.
Scanned / image-only PDFs (be honest)
If extract_text() returns empty or garbage (e.g. (cid:NN) runs) the page is scanned. No OCR engine (tesseract) is installed and network is off, so you cannot recover that text. Say so plainly and stop — do not fabricate content or attempt pip install.
Merge / split / rotate / crop / metadata (pypdf)
from pypdf import PdfReader, PdfWriter
# Merge
w = PdfWriter()
for f in ["a.pdf", "b.pdf"]:
for p in PdfReader(f).pages:
w.add_page(p)
w.write("merged.pdf")
# Split: one file per page
r = PdfReader("in.pdf")
for i, p in enumerate(r.pages, 1):
w = PdfWriter()
w.add_page(p)
w.write(f"page_{i}.pdf")
# Rotate page 0 by 90 degrees clockwise
r = PdfReader("in.pdf")
w = PdfWriter()
r.pages[0].rotate(90)
w.add_page(r.pages[0])
w.write("rotated.pdf")
- Metadata:
PdfReader("in.pdf").metadata(.title,.author, ...). - Crop: set
page.mediabox.left/bottom/right/top(points, origin y=0 at bottom). - Encrypt:
w = PdfWriter(clone_from=PdfReader("in.pdf")); w.encrypt("userpw", "ownerpw"); w.write("enc.pdf"). - Decrypt:
r = PdfReader("enc.pdf"); r.decrypt("pw")ifr.is_encrypted, then read/copy pages.
Watermark (stamp one page over every page):
from pypdf import PdfReader, PdfWriter
wm = PdfReader("stamp.pdf").pages[0]
r = PdfReader("in.pdf")
w = PdfWriter()
for p in r.pages:
p.merge_page(wm)
w.add_page(p)
w.write("stamped.pdf")
Create PDFs (reportlab)
Flowing document (preferred for text/reports/tables — handles pagination):
from reportlab.lib.pagesizes import letter
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib import colors
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle
styles = getSampleStyleSheet()
story = [
Paragraph("Report Title", styles["Title"]),
Spacer(1, 12),
Paragraph("Body text. " * 20, styles["Normal"]),
]
data = [["Product", "Q1", "Q2"], ["Widgets", "120", "135"]]
tbl = Table(data)
tbl.setStyle(
TableStyle(
[
("BACKGROUND", (0, 0), (
Preguntas frecuentes
¿Puede leer un PDF escaneado?
La skill no menciona OCR para PDF escaneados, así que es posible que las páginas escaneadas no salgan como texto.
¿Puede rellenar un formulario PDF?
Sí. Puede rellenar los campos de un PDF, y para formularios planos sin campos puede usar una capa superpuesta.
¿Puede proteger un PDF con contraseña?
Sí. La skill cubre el cifrado y el descifrado de PDF, además de las marcas de agua y los metadatos.
Detalles
Descripción original del autor
Read, extract (text/tables), create, merge/split/rotate, watermark, encrypt, fill, and render-to-image .pdf files. Use whenever the user uploads a .pdf or asks to produce, edit, or pull data out of one.
repo: HKUDS/DeepTutor
Popularidad
- Estrellas en GitHub
- 54 mil
- Posición en el ranking
- #3369
- Licencia
- Apache-2.0
- Actualizada
- 31/10/2026
Comentarios
- …
Más skills de este repositorio
deeptutor-cli
54 milAyuda a tu agente a configurar y ejecutar DeepTutor, una plataforma de aprendizaje, desde su línea de comandos, incluyendo bases de conocimiento, cuadernos y la app web.
docx
54 milAyuda a tu agente a leer, crear y editar archivos Word .docx, incluyendo informes, tablas, buscar y reemplazar, y cambios controlados con comentarios.
pptx
54 milPermite que tu agente cree, lea y edite presentaciones de PowerPoint, incluyendo el texto de las diapositivas, las notas del orador, los gráficos y las imágenes.
skill-creator
54 milEnseña a tu agente a escribir o mejorar skills de DeepTutor, los paquetes cortos de instrucciones que enseñan a una IA una tarea concreta.
Skills parecidas
feishu-doc
394 milAyuda a tu agente a leer, crear y editar documentos en la nube de Feishu, incluidos texto, imágenes y tablas, usando la herramienta de documentos.
feishu-drive
394 milPermite que tu agente explore, organice y comente archivos de una carpeta de la nube de Feishu que se haya compartido con el bot.
feishu-perm
394 milAyuda a tu agente a revisar y cambiar quién puede acceder a un archivo de Feishu, eligiendo el permiso más pequeño que cumpla tu petición.