← Back to Blog
· 4 min read

How AI Detects PDF Form Fields Automatically

The hardest part of automating any government form was never the filling — it was the setup. Someone had to tell the software where every field is: this box is the TIN, this line is the registered name, these twelve cells are the compensation schedule. For a dense form, that mapping used to take an afternoon. Multiply by every form your firm files, and “automation” quietly became a project nobody started.

AI field detection deletes that step. Here’s what it actually does, in plain terms.

The dirty secret of government PDFs

A PDF can contain real, interactive form fields (what the spec calls AcroForm fields) — and when it does, software can simply read them. But most government forms in circulation, including many BIR forms, are flat PDFs: visually they have boxes and lines, structurally they’re just drawings and text. There is nothing for software to “fill” — which is why your PDF editor makes you click into approximate positions and hope the text lands inside the box.

So detection has two jobs:

  1. If real fields exist, use them — their positions are exact, so they anchor the detected fields precisely on the page.
  2. Either way, look at the page the way a human does — and figure out what fields exist, what they mean, and where they should be.

The second job is where AI earns its keep.

How detection actually works

Modern field detection combines a few layers:

  • Layout analysis. The page is parsed into its visual structure: ruled lines, boxes, comb fields (those little cells for one character each), tables, labels. This finds the candidate fields — empty rectangles that expect content.
  • Label association. Each candidate gets matched to nearby text: the box to the right of “TIN” is probably the TIN; the cell column under “Amount” probably wants currency. Reading order, alignment, and proximity all feed the match.
  • Semantic classification. A language-model layer names the field and infers its type — text, number, date, checkbox, currency — from the label and context. “RDO Code” isn’t just a text field; it’s a short numeric code, and good detection knows that.

The output is a structured template: every field with a name, a type, and precise coordinates on the page — built from a blank PDF in seconds.

From blank PDF to fillable template
The detection pipeline, in the order it runs.
  1. 1
    Flat PDF in input
    Boxes and lines a human can read, but no machine-fillable fields underneath.
  2. 2
    Layout analysis vision
    Ruled lines, boxes, comb cells, and tables become candidate fields — empty rectangles that expect content.
  3. 3
    Label association vision
    Each candidate is matched to nearby text: the box beside "TIN" is the TIN; the column under "Amount" wants currency.
  4. 4
    Semantic classification AI
    A language model names each field and infers its type — text, number, date, checkbox, currency.
  5. 5
    Reusable template out output
    Every field with a name, a type, and exact coordinates — ready for prefill and CSV bulk generation.

What this means in practice

When you upload a blank BIR form to BoltPDF, this pipeline runs automatically. You get a clean HTML form listing every detected field, ready to fill — and the PDF gets generated with text placed exactly where the form expects it. Your remaining work is review, not construction:

  • Rename anything ambiguous (“Field_23” → “Employer TIN”)
  • Set defaults for values that repeat across forms (employer info, RDO code)
  • Adjust a field type if the model guessed wrong

That review takes minutes, happens once per form, and the template is reusable forever — including for CSV bulk generation, where the detected fields become the columns you map your data onto, and for prefill templates that carry client data across every filing.

Why it changes the economics

Manual mapping made automation worth it only for the highest-volume forms — the 2316 you file two hundred times. With setup down to minutes, it’s worth automating the form you file four times a year too: the 2551Q, the 1701Q, the odd SSS or Pag-IBIG form a client needs once a quarter. The long tail of forms is exactly where firms bleed the most unnoticed time.

And when the BIR revises a form layout? Upload the new PDF and detection rebuilds the field map in minutes — a quick review pass instead of an afternoon of manual re-mapping.


BoltPDF uses AI field detection to turn any PDF form into a reusable, prefillable template. Try it free.