pdf-toolkit
하는 일
이 스킬은 보고서에서 표를 뽑아내거나 파일을 합치는 등 구조화된 PDF 작업을 수행합니다. 정확하고 반복 가능한 결과가 필요한 사람을 위한 스킬입니다.
사용하는 경우
- ✓PDF 보고서에서 텍스트나 표를 뽑아내야 할 때.
- ✓여러 PDF를 하나로 합치거나 페이지 범위로 PDF를 나누고 싶을 때.
- ✓PDF 양식의 필드를 채우거나 데이터로 새 PDF를 만들어야 할 때.
스킬 링크
https://github.com/TokenRhythm/opensquilla/blob/main/src/opensquilla/skills/bundled/pdf-toolkit/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 PDF 보고서 세 개를 하나의 파일로 합치고, 두 번째 보고서에서 표를 뽑아 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 추출, 합치기, 나누기, 양식 채우기처럼 작업에 맞는 스크립트를 고르고 작업 공간의 파일에 실행합니다. 결과와 완성된 PDF를 돌려줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
PDF 내용을 다시 쓰나요?
직접 다시 쓰지는 않습니다. 내용을 바꾸려면 에이전트가 새 내용을 먼저 작성한 뒤, 이 도구로 최종 PDF를 만듭니다.
파일은 어디에 저장되나요?
파일은 활성 작업 공간에 보관되며, 완성된 PDF도 그곳에서 게시합니다.
필요한 라이브러리가 없으면 어떻게 하나요?
샌드박스 밖에서 다시 시도하지 않고, 스킬이 그 제약을 알려 줍니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 7.1k
- 순위
- #13590
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
browser-use
7.1k에이전트가 OpenSquilla Desktop의 사이드바 브라우저에서 웹 페이지를 열고 읽고 조작하도록 돕습니다. 양식 입력과 화면 확인도 포함합니다.
deep-research
7.1k에이전트가 저장된 계획, 추적되는 출처, 인용이 달린 긴 보고서를 갖춘 다단계 조사를 하도록 가르칩니다.
docx
7.1k에이전트가 서식, 변경 내용 추적, 구조를 그대로 유지하면서 Word .docx 파일을 읽고 편집하거나 만들도록 돕습니다.
html-coder
7.1k에이전트가 접근성 있는 양식과 미디어를 갖춘 깔끔한 HTML 페이지를 쓰고 웹 미리보기로 열도록 돕습니다.
비슷한 스킬
feishu-doc
394k에이전트가 문서 도구를 사용해 텍스트, 이미지, 표를 포함한 Feishu 클라우드 문서를 읽고, 만들고, 편집하도록 돕습니다.
feishu-drive
394k에이전트가 봇과 공유된 Feishu 클라우드 폴더의 파일을 찾아보고, 정리하고, 댓글을 달도록 돕습니다.
feishu-perm
394k에이전트가 요청을 충족하는 가장 작은 권한을 골라, Feishu 파일에 누가 접근할 수 있는지 확인하고 바꾸도록 돕습니다.