pdf-toolkit
Fungsinya
Skill ini menjalankan tugas PDF yang terstruktur, seperti mengambil tabel dari laporan atau menggabungkan berkas. Skill ini ditujukan untuk orang yang bekerja dengan PDF dan menginginkan hasil yang tepat dan dapat diulang.
Kapan dipakai
- ✓Saat Anda perlu mengambil teks atau tabel dari laporan PDF.
- ✓Ketika Anda ingin menggabungkan beberapa PDF menjadi satu atau memisahkan PDF berdasarkan rentang halaman.
- ✓Ketika Anda perlu mengisi kolom formulir PDF atau membuat PDF baru dari data.
Link skill
https://github.com/TokenRhythm/opensquilla/blob/main/src/opensquilla/skills/bundled/pdf-toolkit/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Bisakah Anda menggabungkan ketiga laporan PDF ini menjadi satu berkas dan mengambil tabel dari laporan kedua?”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memilih skrip yang tepat untuk tugas itu, seperti ekstrak, gabung, pisah, atau isi formulir, lalu menjalankannya pada berkas di ruang kerja. Agent mengembalikan hasilnya dan PDF yang sudah jadi.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apakah skill ini menulis ulang isi PDF?
Tidak secara langsung. Untuk menulis ulang, agent menyusun konten baru terlebih dahulu, lalu membuat PDF akhir dengan alat ini.
Di mana berkasnya disimpan?
Skill ini menyimpan berkas di ruang kerja aktif dan menerbitkan PDF yang sudah jadi dari sana.
Bagaimana jika pustaka yang diperlukan tidak tersedia?
Skill ini melaporkan keterbatasan itu alih-alih mencoba lagi di luar sandbox.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 7.1k
- Peringkat
- #13590
- Lisensi
- Apache-2.0
- Diperbarui
- 2/11/2026
Komentar
- …
Skill lain dari repositori ini
browser-use
7.1kMembiarkan agent Anda membuka, membaca, dan mengoperasikan halaman web di browser samping pada OpenSquilla Desktop, termasuk formulir dan pemeriksaan visual.
deep-research
7.1kMengajari agent Anda melakukan riset multi-putaran dengan rencana yang tersimpan, sumber yang dilacak, dan laporan panjang dengan sitasi.
docx
7.1kMembantu agent Anda membaca, menyunting, atau membuat berkas Word .docx sambil menjaga format, perubahan terlacak, dan struktur tetap utuh.
html-coder
7.1kMembantu agent Anda menulis halaman HTML yang bersih dan semantik dengan formulir, media, dan fitur HTML5 yang mudah diakses, lalu membukanya sebagai pratinjau web.
Skill serupa
feishu-doc
394kMembantu agent Anda membaca, membuat, dan mengedit dokumen cloud Feishu, termasuk teks, gambar, dan tabel, dengan memakai alat dokumen.
feishu-drive
394kMemungkinkan agent Anda menelusuri, mengatur, dan memberi komentar pada file di folder cloud Feishu yang sudah dibagikan kepada bot.
feishu-perm
394kMembantu agent Anda memeriksa dan mengubah siapa yang dapat mengakses file Feishu, dengan memilih izin terkecil yang memenuhi permintaan Anda.