All work Developer Tool

1042-S Organizer

Turning a 1,000-page tax PDF into one clean file per recipient

An Adobe Acrobat JavaScript tool that reads a single massive IRS filing PDF, works out which recipient each page belongs to, and splits it into one correctly-named, correctly-ordered file per person — with every form still paired to its instruction page. Built for a real client and running on their machine.

101assertions across 5 test suites
600randomised documents fuzz-tested
20/20names read off the real IRS form

The problem

A tax preparer receives one enormous PDF containing hundreds of IRS 1042-S forms — plus 1099s, W-2s and annual 1042s — for dozens of different recipients, shuffled together and each paired with an instruction page. Splitting and sorting it by hand is hours of error-prone work every filing season, and a misfiled form means sending one client another client's tax data.

What I built

Shipped and proven on the client's own Acrobat installation — four separate bugs reported from the client's real environment were each fixed and then locked down with a permanent regression test. A demo harness downloads the genuine IRS forms from irs.gov, stamps real recipient names into Box 13a, shuffles the pages, and verifies the organiser reconstructs every file correctly with no page lost.

How it works

The tool runs inside Adobe Acrobat as pure Acrobat JavaScript, so it needs no installation and no data ever leaves the client's machine. It reads the text off each page, identifies which IRS form type it is, extracts the recipient from Box 13a, keeps every form glued to its instruction page, then writes one alphabetically-sorted file per recipient plus a CSV manifest. Because Acrobat's scripting engine is single-threaded and freezes the UI on long loops, the runner is chunked so Acrobat stays responsive across a thousand-plus pages.

Shipped to a paying client and proven on their Acrobat — open-sourced with a full test suite

Highlights

  • Runs entirely inside Adobe Acrobat — no install, no upload, tax data never leaves the machine
  • Identifies 1042-S, 1099, W-2 and 1042 pages and groups every form a recipient has into one file
  • Keeps each form paired with its instruction page so nothing is separated in the split
  • Chunked runner keeps Acrobat responsive instead of freezing on long documents
  • CSV manifest export guarded against spreadsheet formula injection
  • Filename sanitisation strips control characters and normalises paths to prevent stray writes
Acrobat JavaScriptNodepdf-libpdfjs-dist
Want one of these?

Let's build yours.

Tell me what you're trying to ship — you'll get a scoped plan and a straight answer.