PDF Editing Issues

Access a PDF Field Label Bounding Box in Acrobat JavaScript

Kushani NimanthikaKushani Nimanthika Nov 25, 2026 868 views

Question details

Determine whether Acrobat JavaScript can access the label object or bounding box associated with a PDF form field.

Can Acrobat JavaScript Access a PDF Field Label Bounding Box?
Product
Adobe Acrobat JavaScript
Device & OS
not provided
Scenario
A user wants to identify the text label and its position for a PDF form field using Acrobat JavaScript.
Observed behavior
The desired result is access to the label or its coordinates, separate from the form field's own bounding box.
Before you start

Check whether the PDF is a standard Acrobat form or an XFA form created with LiveCycle Designer. For a standard form, identify the field name and page containing the visible label before inspecting coordinates.

Solution 1Recommended

Inspect the field and locate its label as page text

Use this approach for standard Acrobat forms, where visible labels are usually separate page content rather than field objects.

A field's rectangle describes the field widget, not the visible label. A field may also have a tooltip, but that text is not necessarily the label printed on the page.

Acrobat JavaScript can inspect extracted page words and their quadrilaterals. You must determine which words form the label; the API does not automatically associate them with the field.

1
Find the field name

Open the PDF in Acrobat, choose Prepare a Form, and select the field to check its name in the field properties.

2
Inspect the field rectangle

Open the JavaScript console in Acrobat and evaluate this.getField("FieldName").rect, replacing FieldName with the actual field name. The returned rectangle is for the field, not its label.

3
Inspect nearby page text

In the console, use this.getPageNumWords(pageIndex) and this.getPageNthWord(pageIndex, wordIndex) to find the label words, then use this.getPageNthWordQuads(pageIndex, wordIndex) to inspect their coordinates. Page and word indexes start at zero.

4
Edit the label separately if needed

To change the visible text rather than just inspect it, use Acrobat's Edit a PDF tool to select the label as page content, if the PDF permits editing.

Inspect the field and locate its label as page text
Text extraction limitations: Word extraction may not identify a label if it is an image or otherwise unavailable as extractable text. Multiword labels may require combining the coordinates of several words.
Free Microsoft Office alternative

Edit PDF Content and Work with Office Files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Microsoft Office files. It can make moving between common document formats straightforward, but it does not provide a fix for Acrobat JavaScript's field-label API limitations.

Open PDFs and use available PDF editing tools to work with page contentCompatible with Microsoft Office formats such as DOCX, XLSX, and PPTXFamiliar interface for users moving from Microsoft OfficeFree, lightweight office suite for everyday document tasks
microsoft office alternative - wps office

Frequently Asked Questions

Does the field's rect property include its label?

No. In Acrobat JavaScript, this.getField("FieldName").rect returns the field widget's rectangle. A visible label in a standard PDF is usually separate page content.

Is a field tooltip the same as its visible label?

Not necessarily. A tooltip is field metadata, while the visible label may be independent text printed on the page.

How can I find the coordinates of a label in a standard PDF?

Use getPageNthWord to identify the label's extracted words and getPageNthWordQuads to inspect each word's coordinates. You must determine which words belong to the label.

What if Acrobat cannot extract the label text?

The label may be an image or otherwise unavailable as extractable text. Inspect the page visually and consider OCR if the label is part of a scan.

Do LiveCycle Designer forms handle labels differently?

Yes. XFA forms created in LiveCycle Designer can have captions associated with fields in the Designer form model. That differs from labels that are independent page content in standard Acrobat forms.