court-form-typewriter
Use when filling flattened/scanned court PDFs or official blank forms so typed values sit on printed lines without gray boxes, cross-outs, or rotation errors. Typewriter overlay + 300 DPI pixel verification; optional Word recreate path.
- License 许可
- MIT
- 最近更新
- 2026-09-18
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- court-form-typewriter
- description
- Use when filling flattened/scanned court PDFs or official blank forms so typed values sit on printed lines without gray boxes, cross-outs, or rotation errors. Typewriter overlay + 300 DPI pixel verification; optional Word recreate path.
02 资源文件 6
- 参考文档references/examples.md1.4 KB
- 脚本scripts/detect_lines.py3.6 KB
- 脚本scripts/fill_acroform_clean.py3.9 KB
- 脚本scripts/pdf_to_docx.py891 B
- 脚本scripts/typewriter_fill.py2.3 KB
- 脚本scripts/verify_on_line.py3.4 KB
03 SKILL.md 正文
Court Form Typewriter
When to use
- Official court PDFs that are scanned / flattened / image-based (no reliable AcroForm appearance)
- User requires text on the blank lines, not floating and not crossed through by the underscore
- Prior fillable-widget fills produced gray bars, wrong rotation, or values lost on flatten
- Multi-page divorce / family packets (Pro Se, Pauper’s, UCCJEA, Waiver, Summons, Jurisdictional, etc.)
Hard rules (never violate)
- One form at a time. Perfect page 1 before multi-page forms.
- Fill blanks only. Never erase, whiteout, or cover printed legal text (
Petitioner/Respondent (circle one), statutes, clerk language). - Leave execution blank: signatures, notary, dates-to-sign, judge/clerk-only fields (unless user explicitly provides them).
- No gray widget backgrounds. Do not deliver unflattened fillable PDFs with
MK BG/BCgray bars to mobile viewers. - Never claim complete until 300 DPI render + field crops + pixel checks pass. Vision alone is not enough.
- Unique deliverable names when re-sending (avoid phone PDF cache): append
_vNor timestamp. - Rotation: if source
page.rotation != 0, always render withpdftoppm(respects rotation) before measuring/drawing. Output final PDF must be upright portrait for letter forms unless the official form is truly landscape content.
Preferred pipeline (flattened / scanned official forms)
A. Typewriter overlay (default — best for Tulsa/OK scanned blanks)
# 1) Render blank official page at 300 DPI (rotation-safe)
pdftoppm -r 300 -png SOURCE.pdf /tmp/form_src
# 2) Detect underscore Y positions + label X ends
python3 scripts/detect_lines.py /tmp/form_src-1.png --out /tmp/lines.json
# 3) Place text with baseline ABOVE the line (not through letters)
python3 scripts/typewriter_fill.py \
--source-png /tmp/form_src-1.png \
--fields /path/to/fields.json \
--lines /tmp/lines.json \
--out /path/to/OUT.pdf \
--dpi 300 --font-size 48 --raise-px 6
# 4) Mandatory verification (must exit 0)
python3 scripts/verify_on_line.py --filled-png /tmp/OUT_300.png --source-png /tmp/form_src-1.png --fields /path/to/fields.json
Placement law (learned the hard way):
- Use PIL
draw.text(..., anchor='ls')soyis the baseline. - Set baseline to
line_y - raise_pxwithraise_pxdefault 6 at 300 DPI so letter bodies clear the stroke. - Pixel gate:
added_on_line < 80vs blank source, and substantial dark mass above the line. - Font: DejaVu Serif or Liberation Serif ~13pt → ~48px at 300 DPI (match printed label height via OCR).
B. True AcroForm fillable (only if source has real widgets AND no baked gray)
- Fill with pymupdf / fillpdf using form-specific field dicts (never one shared dict across form types).
- Strip widget gray: remove
/MK(BG/BC),/BS, regenerate/APviawidget.update(). - Flatten only after visual proof values appear:
pdftoppmrender of filled file. - If caption values vanish on render → abandon widgets, use pipeline A on the non-fillable scan twin.
C. Word recreate (when user wants editable DOCX match)
# PDF → DOCX (layout approx; always human-check)
python3 scripts/pdf_to_docx.py SOURCE.pdf /tmp/form.docx
# Edit/fill with python-docx OR LibreOffice, then:
soffice --headless --convert-to pdf --outdir /tmp /tmp/form_filled.docx
# Then run verify_on_line on the exported PDF render
Use Word path for born-digital text forms. For scanned court images, typewriter (A) wins.
Verification checklist (every page)
Run scripts/verify_on_line.py and confirm:
| Check | Pass criteria |
|---|---|
| Orientation | Final page upright; rotation=0 after flatten; width < height for letter portrait |
| No added margin vertical text | Left/right 0.2" margins match source dark-pixel count (±tolerance) |
| No gray boxes | Empty corners gray≈0; no solid mid-gray rectangles over fields |
| On-line, not crossed out | Text mass above line; added_on_line near 0 |
| Values correct | OCR or known string present in field crop |
| Signature/notary blank | No added dark mass in execution zones |
| Printed text intact | Diff vs source only in intended field bands |
Also crop each field and open crops with vision_analyze, but pixel script is the gate. If vision and pixels disagree, trust pixels + send unique file to user.
Failure modes already burned
| Symptom | Cause | Fix |
|---|---|---|
| Gray bars on phone | Fillable MK BG[.96.96.96] |
Don’t ship widgets; typewriter on scan |
| Values blank after flatten | get_pixmap/pdftoppm dropped appearances |
Typewriter, or strip+regen AP then verify render |
| Text “crossed out” | Baseline on/below underscore | anchor='ls', raise_px=6+ |
| Landscape / vertical margin names | Source /Rotate 270 mishandled |
Always pdftoppm first; draw on upright raster |
| Wrong utility $ got phone # | Shared field name dict across forms | Per-form field maps only |
| User sees old PDF | Telegram/cache | New filename every deliverable |
Oklahoma divorce packet notes
- Sources often live under
/root/.hermes/cache/documents/(*_FILLABLE.pdfand scanned twins liketulsa_FormsProSeEntryofAppeance.pdf). - Pro Se scan is portrait media box with rotation 270 — treat as upright after pdftoppm.
- Preserve
Petitioner/Respondent (circle one); leave physical circle to parties. - Case number may stay
FD-____________until clerk assigns. - Do not promise court acceptance; maximize legibility and blank integrity.
Scripts in this skill
| Script | Purpose |
|---|---|
scripts/detect_lines.py |
Find underscore Y and label ends via dark runs + OCR |
scripts/typewriter_fill.py |
Overlay fields onto blank 300 DPI page → PDF |
scripts/verify_on_line.py |
Pixel gates; exit 1 on any fail |
scripts/pdf_to_docx.py |
pdf2docx wrapper |
scripts/fill_acroform_clean.py |
Optional AcroForm fill + strip gray + render check |
One-page success gate (user standard)
Put the words on the lines and not crossed out.
Only after that passes for one page, proceed to 3–4 page forms using the same scripts and gates.
04 同仓库更多 Skills
zopack
Export and import zo.space route setups as shareable .zopack.md files. Use when the user wants to package their zo.space routes for sharing, or when they receive a .zopack.md file to deploy. Triggers on "export my zo.space", "create a zopack", "import this zopack", or any mention of .zopack.md files.
zoho-mail-inbox
Full inbox management for Zoho Mail (info@justlegalsolutions.org) — list unread, mark all as read, delete by sender/keyword, search, send from aliases, list folders. Fully self-contained — zero setup needed.
weekly-meeting-reminder
Get an email every Sunday evening listing your meetings for the coming week.
Let Zo use your X (Twitter) account
zo-tools
Internal process tools for Zo and Hermes — local search, document processing, OCR, and embeddings. All services run on localhost, zero HTTP slots consumed.
ssh-setup
Sets up secure remote access to your Zo Computer so you can connect from anywhere