Using Acrobat JavaScript in Forms
Making Forms Accessible
6
Making Forms Accessible
Making a PDF Form accessible to users who have impaired motor or visual ability requires
that the document be structured, which means that PDF tags present in the document
ensure that the content is organized according to a logical structure tree. This means that
you will have added tags to the document. Once you do this, you may specify alternative
text within the tags.
You can make forms accessible through the use of Text-To-Speech engines and tagged
annotations containing alternative text.
Text-To-Speech engines can translate structured text in a PDF document into audible
sound, and tagged annotations containing alternative text can provide substitute content
for graphical representations, which cannot be read by a screen reader. It is useful to
consider embedding alternative text in links and bookmarks, as well as specifying the
language of the document.
It is not necessary to sacrifice security in order to make a document accessible. Select
Document Properties > Security > Enable Text Access for Screen Reader Devices for
the Visually Impaired.
Text-To-Speech
In order for Text-To-Speech engines to be able to work with your document, it must be
structured. You can create structured documents using Adobe FrameMaker
®
7.0 or Adobe
FrameMaker SGML 6.0 running in
Structured
mode.
To access the Text-To-Speech engine from Acrobat JavaScript, use the
TTS
object, which
has methods to render text as digital audio and present it in spoken form to the user.
For example, the following code displays a message stating whether the TTS engine is
available:
console.println("TTS available: " + tts.available);
The next code sample illustrates how to enumerate through all available speakers, queue a
greeting into the TTS object for each one, and present the digital audio version of it to the
user:
for (var i=0; i<tts.numSpeakers; i++) {
var cSpeaker = tts.getNthSpeakerName(i);
console.println("Speaker[" + i + "] = " + cSpeaker);
tts.speaker = cSpeaker;
tts.qText("Hello");
tts.talk();
}
Acrobat JavaScript Scripting Guide
117