data-id=acrobat-pdfl-sdk-accessibility

Acrobat-PDFL SDK: Accessibility

Adobe provides methods to make the content of a PDF file available to assistive technology such as screen readers:

The DOM and MSAA models are related, and developers can use either or both. Acrobat issues notifications to accessibility clients about interesting events occurring in the PDF file window and responds to requests from such clients.

Warning

This document assumes that you are familiar with the ATK architecture.

data-id=determining-rendering-order-and-logical-order

Determining rendering order and logical order

When rendering documents on the screen, Acrobat provides visual fidelity in a device-independent manner. However, the order in which Acrobat renders characters is not necessarily the same as the order in which they are to be read. Acrobat does not use standard system services that are used by assistive technology to capture content displayed on the screen.

Tagged PDF, introduced in PDF 1.4, defines a logical structure for the document that corresponds to the logical order of the content, regardless of the order in which the content is rendered. Acrobat uses the logical structure of a Tagged PDF document to determine word order. Through the accessibility interfaces, Acrobat can deliver the text of the PDF file as Unicode and can also make active elements such as links and form fields accessible.

Note

Acrobat can determine the logical structure of an untagged PDF file to some extent, but the results may be less satisfactory.

data-id=accessing-documents-and-pages

Accessing documents and pages

Through the accessibility interfaces, Acrobat can deliver contents of the entire PDF document contents or only the current visible pages, regardless of what part of the document is visible on the screen:

The user controls the delivery method using the reading preferences.

data-id=processing-inaccessible-documents

Processing inaccessible documents

A document can be inaccessible for one of the following reasons:

The interfaces treat inaccessible documents as follows:

data-id=57086
data-id=processing-protected-documents

Processing protected documents

A document may have security settings that make it inaccessible. This can occur under the following conditions:

In these cases, the user must contact the document author to provide a version that permits accessibility.

The following occurs when a document has security settings that make it inaccessible:

You can become an Adobe Trusted Partner and create Trusted Assistive Technology. Trusted Partners are developers of assistive products that respect the copy protection of encrypted PDF files, and can gain access to 40-bit encrypted files. For more information on becoming a Trusted Partner, see http://www.adobe.com/go/acrobat_developer.

data-id=97997
data-id=processing-empty-documents

Processing empty documents

A document can be inaccessible because it is empty, or it can appear empty because of the way the PDF was created. For instance, scanned images that have not been run through an optical character recognition (OCR) tool appear to be empty. Malformed structure trees can also make a document appear empty.

The following occurs when a document appears to be empty:

data-id=45172
data-id=processing-unavailable-documents

Processing unavailable documents

When a document is unavailable, Acrobat returns similar objects from MSAA and DOM. A document may be unavailable for one of several reasons:

In all these cases, when using the DOM, the status returned in GetDocInfo is DocState_Unavailable.

data-id=21082
data-id=handling-event-notifications

Handling event notifications

Each open document in Acrobat is associated with its own window handle. All WinNotifyEvent notifications for any part of the document use that window handle. For the PDF window:

For Acrobat 7.0 and later, the following occurs:

data-id=retrieving-an-msaa-object-for-an-event

Retrieving an MSAA object for an event

You can retrieve an IAccessible object from event notifications by using the MSAA function AccessibleObjectFromEvent. This object represents the document or an element within the document.

Some events always return an object of a particular type. For others, you must determine the type of the object from the role and specific childID. The meaning of the event can be different for different types of objects. For more information, see Identifying IAccessible objects in a document.

Acrobat posts the following WinEvent notifications:

Notification
Description
EVENT_OBJECT_FOCUS
The document window, a link, a comment, or a form field has received keyboard focus.
AccessibleObjectFromEvent
Returns the appropriate IAccessible object, either for the document or page itself or for the link, comment, or form field. The childID parameter identifies the object.
EVENT_OBJECT_LOCATIONCHANGE
The caret (text cursor) has moved. If the caret is in a text edit field containing keyboard focus, the value of the text field may also have changed. The idObjectType parameter for this event is objid_caret. AccessibleObjectFromEvent returns an IAccessible object for the caret.
EVENT_OBJECT_STATECHANGE
If the childID parameter is CHILDID_SELF, the current document or page has changed its state by opening or closing a comment. The client should update its copy of the document content. Only the IAccessible object for the comment changes when this occurs. If childID is non-zero, it is the UID of the IAccessible object for a form field, such as a checkbox or radio button, whose state has changed.
EVENT_OBJECT_VALUECHANGE
If the childID parameter is CHILDID_SELF, a new document or page has been opened or the current content has changed. The client should update its cached value of the document or page. If the childID parameter is not CHILDID_SELF, it identifies the content on the page to which the user has turned his or her attention. For instance, if a page has scrolled or Acrobat has followed a link to a new page, it identifies the first visible content on the page. The client may wish to update its internal state about where it is reading the document.
data-id=retrieving-a-pdf-dom-object-for-an-event

Retrieving a PDF DOM object for an event

To retrieve a DOM object, you can do one of the following actions: