A browser-only utility for migrating the interactive AcroForm field layer from an older USCIS PDF edition to a newer USCIS PDF.
USCIS frequently updates form editions. The visible PDF pages may change, but the underlying AcroForm layer still needs to be inspected, compared, migrated, and verified. This tool helps move that field layer forward without rebuilding every field by hand.
The migrator takes two PDFs:
- PDF-1: an older USCIS edition with the AcroForm fields you want to preserve.
- PDF-2: a newer USCIS edition that should receive those fields.
It extracts the field names, types, widgets, page numbers, rectangles, flags, values, default appearances, and page geometry from PDF-1. It can then transplant the source AcroForm layer into PDF-2 and verify that the generated PDF still contains the expected fields at the expected page coordinates.
Important: this tool does not work directly with the PDFs USCIS provides, because those files are typically XFA forms. In our workflow, we manually convert the USCIS PDF into an AcroForm PDF first, then use this tool on the converted AcroForm version.
This project was built by the founder of Fillvisa, an immigration form workflow product. It is something we use internally in the Fillvisa workflow to keep form automation reliable as USCIS releases new PDF editions.
The broader Fillvisa open-source project is available at athos2113/fillvisa-os.
Earlier versions recreated fields with pdf-lib's high-level form API and copied selected properties back onto the new fields. That preserved many important details, but pdf-lib could still create its own field/widget structure and regenerate text appearances.
v2.3 uses a raw AcroForm transplant instead. It deep-copies the source PDF's actual /AcroForm object graph into PDF-2 rather than recreating fields with calls such as createTextField() or createCheckBox().
This preserves source PDF objects such as:
- the
/Fieldstree; - merged field/widget structures;
/DAdefault appearance strings;/DRresources and source font resource names;/Ff,/MaxLen,/Q,/MK,/BS,/Border,/F, and related dictionary entries;- the exact presence or absence of
/APappearance streams; - checkbox and radio On/Off artwork;
- exact widget
/Rectvalues.
Only the widget page relationship is intentionally changed so that copied widgets point to the matching pages in PDF-2.
The app runs entirely in the browser using pdf-lib.
At migration time, it:
- loads PDF-1 and PDF-2;
- temporarily removes
/Ppage references from source widgets so the old page tree is not imported; - deep-copies the source
/AcroForminto PDF-2 withPDFObjectCopier; - restores PDF-1's in-memory
/Preferences; - finds copied fields by source manifest name and widget index;
- sets each copied widget's
/Preference to the corresponding PDF-2 page; - restores the exact source
/Rect; - inserts copied widget annotation references into the target page
/Annotsarrays; - saves the generated PDF with
updateFieldAppearances: false; - reopens the output and verifies field placement and low-level fidelity.
Open index.html in a browser.
Then:
- Manually convert the USCIS-provided XFA PDFs into AcroForm PDFs.
- Upload the old converted AcroForm PDF as PDF-1.
- Review the extracted field manifest, table, JSON, or CSV export.
- Upload the new converted AcroForm PDF as PDF-2.
- Keep Replace existing AcroForm fields in PDF-2 enabled for normal migrations.
- Optionally enable Copy current values from PDF-1 if you want source values retained.
- Click Insert fields into PDF-2.
- Review the migration verification report.
- Download the generated PDF.
The repository also includes about.html, a short public-facing project page.
The migration report checks:
- raw-transplanted field and widget counts;
- widget
/Preferences remapped; - exact
/Rectvalues restored; - annotations attached to PDF-2 pages;
- maximum coordinate delta;
- AcroForm
/DApreservation; - copied
/DRresources; - per-field
/DAand per-widget/APpresence fidelity.
PDF parsing and migration happen locally in the browser. The app itself does not upload selected PDFs to a server.
The page loads pdf-lib 1.17.1 from a CDN, so that CDN must be reachable unless you modify the project to serve the dependency locally.
- This tool is for AcroForm PDFs. It will not work directly with USCIS-provided XFA PDFs.
- Convert USCIS XFA PDFs into AcroForm PDFs before using this utility.
- XFA data is removed during migration because pdf-lib does not support XFA editing.
- PDF-2 must contain the corresponding page numbers for copied widgets to be placed.
- Page geometry warnings are shown when sizes, origins, or rotation differ.
- Exact source coordinates do not compensate for USCIS moving printed content between editions.
- PDF-2 page content is not replaced or altered.
- Manual adjustment may still be needed when the visible form layout changed between editions.