Pdf inspection
Skill cxcscmu/SkillLearnBench/skills/b1-one-shot-gemini-3-flash-preview/court-form-filling/pdf-inspection
Techniques for inspecting PDF form fields and their properties using Python libraries like pypdf.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill pdf-inspectionAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.2 KB, 276 tokens by cl100k_base, as published. Nobody here has run it
PDF Inspection Skill
This skill covers how to identify and list form fields in a PDF document using the pypdf library.
Prerequisites
- Python 3.x
pypdflibrary (pip install pypdf)
Usage Patterns
Listing All Fields
To list all fields and their types:
import pypdf
def list_pdf_fields(file_path):
reader = pypdf.PdfReader(file_path)
fields = reader.get_fields()
if not fields:
print("No fields found.")
return
for name, field in fields.items():
field_type = field.get("/FT")
print(f"Field Name: {name}, Type: {field_type}")
list_pdf_fields("document.pdf")
Understanding Field Types
/Tx: Text field/Btn: Button (checkbox or radio button)/Ch: Choice field (dropdown or list box)/Sig: Signature field
Identifying Checkbox Values
Checkboxes often use "Off" and another value (like "Yes" or "On"). You can find these in the /AP or /V keys if they have a value.
field_props = reader.get_fields()["field_name"]
print(field_props.get("/V")) # Current value
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.