pdf-toolkit
Qué hace
Esta skill realiza tareas estructuradas con PDF, como extraer tablas de un informe o combinar archivos. Es para personas que trabajan con PDF y quieren resultados exactos y repetibles.
Cuándo usarla
- ✓Cuando necesitas extraer texto o tablas de un informe en PDF.
- ✓Cuando quieres combinar varios PDF en uno o dividir un PDF por rangos de páginas.
- ✓Cuando necesitas rellenar los campos de un formulario PDF o crear un PDF nuevo a partir de datos.
Link de la skill
https://github.com/TokenRhythm/opensquilla/blob/main/src/opensquilla/skills/bundled/pdf-toolkit/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 unir estos tres informes en PDF en un solo archivo y extraer las tablas del segundo?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente elige el script adecuado para la tarea, como extraer, unir, dividir o rellenar un formulario, y lo ejecuta sobre los archivos del espacio de trabajo. Devuelve los resultados y el PDF terminado.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
pdf-toolkit
Deterministic, structural PDF operations. Use this skill for programmatic work where you know exactly what you want done. For a natural-language rewrite, first draft the replacement content with ordinary reasoning, then use the explicit extract/generate/merge operations here to create the final PDF.
Use the inline Python examples with execute_code in a restricted channel.
Keep files in the active workspace and call publish_artifact with the
finished PDF. Shell commands below require an available exec_command;
they are optional shortcuts, not a reason to request host execution. If the
sandbox or a required library is unavailable, report the limitation rather
than retrying outside the sandbox.
Decide the operation
| Goal | Script |
|---|---|
| Get text or tables out of a PDF | extract.py |
| Combine pages from multiple PDFs | merge.py |
| Split a PDF by page ranges | split.py |
Fill /Tx form fields in a PDF |
form_fill.py |
| Build a new PDF from data | inline reportlab snippet, see Path C below |
Path A: Extract
python {baseDir}/scripts/extract.py /path/to/doc.pdf --json
Output:
{
"pages": 12,
"metadata": {"title": "...", "author": "..."},
"text": [
{"page": 1, "content": "..."},
{"page": 2, "content": "..."}
],
"tables": [
{"page": 3, "rows": [["..."], ["..."]]}
]
}
Text uses pdfplumber (already in default dependencies) which preserves
column layout better than naive PDF text extraction. Tables use
pdfplumber.extract_tables() with default settings; for tricky layouts
pass --tables-strategy lines|text|explicit to switch detection mode.
For OCR (scanned PDFs), this skill does not include Tesseract — use the sibling skill that wraps an OCR engine (out of scope here).
Path B: Merge / Split
Merge full files:
python {baseDir}/scripts/merge.py a.pdf b.pdf c.pdf --out combined.pdf
Or merge specific page ranges with the manifest form:
python {baseDir}/scripts/merge.py manifest.json --out combined.pdf
manifest.json:
[
{"file": "a.pdf", "pages": "1-3"},
{"file": "b.pdf", "pages": "5,7,9-11"},
{"file": "c.pdf"}
]
Page ranges are 1-based, comma-separated, hyphen for ranges. Omit pages to
include the whole file. Splits use the same syntax in reverse:
python {baseDir}/scripts/split.py input.pdf --pages "1-3,7,10-12" --out output_dir/
Each range writes one output file: output_dir/input_001.pdf,
output_dir/input_002.pdf, …
Path C: Form fill
python {baseDir}/scripts/form_fill.py form.pdf data.json --out filled.pdf
data.json maps field name → string value:
{
"applicant_name": "Wei E.",
"submission_date": "2026-05-06",
"agreed": "Yes"
}
The script discovers fields via pypdf.PdfReader.get_fields() and updates
them with update_page_form_field_values(). Fields not present in the JSON
are left untouched. Run with --list-fields to enumerate the form's fields
without filling.
Caveats:
/Btncheckbox fields take the export value (oftenYes,On, or1) rather thantrue— inspect with--list-fieldsto discover.- AcroForm fills only. XFA forms (used by some legal templates) require Adobe-specific tooling and are out of scope.
- Some signed PDFs invalidate the signature when fields change. Strip
signatures explicitly with
--clear-signaturesif that is intended.
Path D: Generate from scratch
Use reportlab directly when you need a new PDF:
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import LETTER
from pathlib import Path
c = canvas.Canvas(str(Path("out.pdf")), pagesize=LETTER)
c.setFont("Helvetica-Bold", 18)
c.drawString(72, 720, "Q3 Review")
c.setFont("Helvetica", 11)
c.drawString(72, 696, "Revenue grew 18% year over year.")
c.showPage()
c.save()
For Chinese text, register a CJK font instead of Helvetica. ReportLab's CID font works without downloading fonts or reading a user font directory:
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.cidfonts import UnicodeCIDFont
from reportlab.pdfgen import canvas
pdfmetrics.registerFont(UnicodeCIDFont("STSong-Light"))
c = canvas.Canvas("report.pdf")
c.setFont("STSong-Light", 14)
c.drawString(72, 760, "季度报告:收入增长")
c.save()
CID fonts rely on PDF reader CJK support. When an embedded font is required, use a licensed font already available inside the workspace or permitted
Preguntas frecuentes
¿Reescribe el contenido del PDF?
No directamente. Para reescribirlo, el agente redacta primero el contenido nuevo y luego crea el PDF final con estas herramientas.
¿Dónde se guardan los archivos?
La skill mantiene los archivos en el espacio de trabajo activo y publica desde allí el PDF terminado.
¿Qué pasa si falta una biblioteca necesaria?
La skill informa de la limitación en lugar de reintentar fuera del entorno aislado.
Detalles
Descripción original del autor
Structured `.pdf` operations: extract text/tables, merge pages from multiple PDFs, split a PDF by page ranges, fill PDF form fields, and generate fresh PDFs from JSON. Trigger when the user wants deterministic programmatic PDF work — examples: pull tables from a report, combine three PDFs, extract pages 5-12, fill a tax form, or build a new PDF from data. This is the single public PDF entry and uses pypdf, pdfplumber, and reportlab.
repo: TokenRhythm/opensquilla
Popularidad
- Estrellas en GitHub
- 7,1 mil
- Posición en el ranking
- #13590
- Licencia
- Apache-2.0
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
browser-use
7,1 milPermite que tu agente abra, lea y maneje páginas web en el navegador de la barra lateral de OpenSquilla Desktop, incluidos formularios y comprobaciones visuales.
deep-research
7,1 milEnseña a tu agente a hacer investigaciones de varias rondas con un plan guardado, fuentes registradas y un informe largo con citas.
docx
7,1 milAyuda a tu agente a leer, editar o crear archivos Word .docx conservando el formato, los cambios con seguimiento y la estructura.
html-coder
7,1 milAyuda a tu agente a escribir páginas HTML limpias y semánticas, con formularios accesibles, multimedia y funciones de HTML5, y a abrirlas como vista previa web.
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.