JavaScript APIs — Acrobat-PDFL SDK: JavaScript Reference

Looking for:

Looking for:

Adobe acrobat pro dc javascript api free download

Click here to Download

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
The placement of a script at a given level also determines its reusability. This method is available only during batch, console and application initialization. For a list of stamp names currently in use in the document, see перейти Doc object icons property.
 
 

 

Applying actions and scripts to PDFs

 

The Console Window is the best of the bunch. The other tools are very useful and have much better performance and stability in Acrobat XI than in previous versions. However, the Console Window remains many times faster and easier to use than the other tools, as well as being error free.

The Console Window is a multi-purpose and somewhat generic tool. It is the default location where JavaScript error messages are displayed as well as being an entry window for testing and debugging Acrobat JavaScript code. It can also be used to execute code snippets to automate tasks in Acrobat and to analyze documents.

It does not do everything needed to debug code, but it does provide a quick and easy way to perform most of the code development tasks you\’ll ever need to do. In this article, we\’ll cover setting up and using this essential tool. Note: Special instructions for using the Console Window with Reader are provided at the end of the article. If this is your first time using the Console Window, you will need to enable and configure it from Acrobat\’s Preferences settings.

Depending on your platform, use one of the following methods to open the Preferences dialog Figure 1. In Preferences, select the JavaScript panel. These are the two most important preference settings. In fact, both of these settings may already be checked. JavaScript is turned on by default, and Acrobat will automatically ask you if you want to turn on the Console Window if you attempt to use it.

It is not a good idea to check Enable JavaScript debugger after Acrobat is restarted, except in two situations. First, you can enable it temporarily in order to change the \”Exception\” options. I prefer the options as they are shown in Figure 1, but uncheck this option before exiting the preferences.

The reason for not enabling the debugger is because it has a significant negative impact on Acrobat performance, and can even cause Acrobat to crash. So the only reason you would actually turn on the debugger is if you needed to use the debugging tools. If you don\’t already know how to use software debugging tools, you are much better off sticking to the Console Window.

A very useful feature is the external JavaScript editor, since the default Acrobat editor is very basic. A good JavaScript editor will have advanced features that make code manipulation and navigation easier when you are editing document code.

You won\’t be using the JavaScript editor with the Console Window, but this group of settings has an interesting effect on it. The Acrobat editor font and size settings are the same settings used in the Console Window.

You can see in Figure 1 that I have chosen to use an external editor. This selection disables the Acrobat editor and grays out the font and size settings. However, these are still the settings used by the Console Window. If you want to change them you\’ll need to temporarily enable the Acrobat editor to modify the settings, then reselect the external editor. In order for the settings to take affect you\’ll need to close and reopen the Console Window.

After these preferences have been set Figure 1 , you\’re ready to start using the Console Window. The shortcut key can be a bit tricky on the Macintosh because there are slight differences between the keyboards on laptop and desktop systems. So the keyboard shortcut is not always valid, but the tool button will always work.

The tool panels are a new feature introduced in Acrobat X, so displaying the Console in earlier versions is slightly different. The Shortcut key is the same, but instead of a tool button, these earlier versions use a menu item. The Console Window section of the Debugger is in the bottom portion of the dialog, in the area labeled View.

In Figure 3, the View pull-down selection list is set to Console, meaning the Console Window is being shown. This area is also used to show the Script window for displaying runtime code when the debugger tools are enabled.

In the figure, the Console is being shown immediately after Acrobat was started. The status messages are displayed by code built-into Acrobat and loaded on startup. Each line represents a JavaScript module loaded by Acrobat. If there were any problems with these modules, or any others that Acrobat loads, error messages would also be displayed here. Normally, we\’re not interested in these initial messages.

So if you would like to try out some of the code presented here as examples, then clear the window by pressing the button that looks like a garbage can in the lower right corner of the window.

Now we have a clean work area and are set up and ready to start using the Console Window. JavaScript code can be executed directly from the Console Window.

This ability is a huge time saver since it provides a fast and easy way to test out code before it\’s placed into a scripting location where it will be more difficult to debug. To run the code, make sure the cursor is on the same line as the text.

You can place it anywhere on the line as long as nothing is selected. Either of the two following actions will cause Acrobat to run the code. Acrobat always attempts to convert the result of an execution into text so that it can be displayed. Sometimes the result of an operation is not as clean or obvious as a number. Let\’s try something that doesn\’t have such a well-defined result. Enter the following line in the Console Window and run it:.

This calculation has an obvious mathematical error, but Acrobat JavaScript doesn\’t display an error message. Instead, as shown in Figure 5 , it displays the word \”Infinity. It is much easier to find this kind of issue by executing individual lines in the Console Window where you can see the results immediately, than it is to debug it from a field-calculation script. The next line of example code is something that might be used in a real script. It assigns a simple addition to a variable named \’sum\’.

As shown in Figure 6, the return value from this line of code is \”undefined. The calculation is executed and applied to the declared variable, sum. However, the first and primary operation on the line is the variable declaration, so this is the operation that returns a value to the Console Window.

Unfortunately, variable declarations do not return a value. To overcome this small issue, the Console widow displays \”undefined. Anything that doesn\’t exist to the JavaScript environment is \”undefined. This action executes just the selected text. This technique of selecting parts of the code for execution is also useful for executing multiple lines of code. So far we\’ve talked about executing code in the Console Window for testing and debugging, but there is no reason to restrict our usage to this limited theme.

Immediate Mode means that anything entered into this window is executed directly by the JavaScript engine. We can use it anytime we want to execute code for any purpose. Two uses for the Console Window besides code testing that immediately come to mind are automation and analysis. There are several functions in Acrobat for manipulating and for acquiring information from PDFs and Acrobat. For operations with a user interface button or menu item, the main advantage of using JavaScript is greater flexibility, since JavaScript functions typically provide more options than the user interface equivalent.

For example, suppose you wanted to know the exact border color of a text field so you could use the same color in another location. Assuming the current document has a field with the correct name on it, the following code displays the raw color value in the Console Window:. The result of this operation is a color array. Remember, Acrobat attempts to convert all results into text. Arrays are converted to text by converting each individual array element into a text string, so the result would look something like the following line when it is displayed in the Console Window.

This is an example of document analysis with JavaScript. We\’ve just found out something that would have taken us just a little more effort to find out using the Acrobat property dialogs, and the information is in a very usable format. We can easily copy and paste this information to accomplish some other purpose, for example applying the color to another field with this line of code:.

Suppose a document needs to be checked for branding purposes, i. The following code uses a simple loop to display this color info in the Console Window for manual inspection:. Because of the loop, this code cannot be executed one line at a time. It has to be done all at once.

Notice that in the loop there is a function called console. It\’s in the fourth line. This function writes text to the Console Window and it will be discussed in the next section. Here\’s an example of a function that does not have an easy equivalent on the regular Acrobat menus and toolbars.

Enter the following line into the Console Window and run it:. Acrobat will create a new, blank PDF document. This is perfect for trying out new ideas before applying them to a working document. The results of this operation are shown in Figure 7 below. Note that yet again, the result is something different. The result shown in Figure 7 tells us the type of object created.

This result is only useful in letting us know the function worked. If app. Both of these situations would have been displayed in the Console Window. The path property is exactly what you might think it should be.

 
 

Add debug JavaScript, Adobe Acrobat

 
 

Dedicated community for Korean speakers. Your guidance on this matter would be greatly apreciated. Thanks, Steve. Follow Report.

Community guidelines. Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more. Jump to latest reply. Document-level JavaScript code is easier to distribute since it can be included directly within the PDF file and does not require an installer.

Plug-ins can access and manipulate low-level objects in the PDF object model, such as the Cos layer. Execution of JavaScript code is slower than plug-in code because it is interpreted instead of compiled. However, the difference is noticeable only in computation-intensive applications, such as a full-text search in a large PDF file. You must include all necessary header files for your application. JavaScript scripts are easier to write and implement since they are developed using the editor and debugger that come as part of Acrobat Professional DC.

Developers can also use an external editor to create and edit JavaScript code. Finally, while some JavaScript and plug-in capabilities overlap, others are only available in JavaScript while others are only available with a plug-in as summarized in the table below. JavaScript for Acrobat is well-suited to quickly tasks such as adding user interface capabilities, forms processing, interacting with databases and web services, and so on.

However, this is a time-consuming approach and requires an in-depth knowledge of the low-level APIs. To take advantage of Acrobat functionality from within an external application, use interapplication communication IAC.

NET, or Visual C. CodeWarrior is not supported. When you open a document for viewing using the PDF Browser Controls, the document is displayed in the application window.

Acrobat toolbars are also displayed and can be used with no additional API calls. The toolbars can be hidden. You must place your own buttons with corresponding API calls for standard toolbar tasks such as printing and searching.

The Acrobat SDK provides a sample that demonstrates this. Acrobat provides a rich set of JavaScript programming interfaces that are designed to be used from within the Acrobat environment. It also provides a mechanism that allows external clients to access the same functionality from environments such as VB.

NET and Visual C. Acrobat Reader does not support OLE. On Windows, you can display a PDF document in applications using simplified browser controls. Once the PDF document is loaded, you can implement browser controls to perform the following tasks:. IAC support includes some of the objects and events described in Apple Event Registry: Standard Suites , as well as Acrobat-specific objects and events. The Adobe PDF Library is based on the core technology of the Acrobat line of products and offers complete functionality for generating, manipulating, rendering, and printing Adobe PDF documents.

The library enables PDF functionality to be seamlessly embedded within applications without the presence of Acrobat or Acrobat Reader. It also provides a reliable, accurate, and Adobe-supported implementation of the latest PDF specification. They differ in providing access to the Acrobat user interface:. The Acrobat SDK is designed for Acrobat product environments and allows you to control and interact with the Acrobat user interface.

What is the FDF Toolkit? Visual Basic. If the bookmark already exists in the bookmark tree, it is unlinked before inserting it back into the tree. In addition, the insertion is checked for circularities and disallowed if one exists. This prevents users from inserting a bookmark as a child or grandchild of itself. See also the children property and the createChild and remove methods. Removes the bookmark and all its children from the bookmark tree.

See also the children property and the createChild and insertChild methods. A static object that accesses the functionality provided by the Acrobat Catalog plug-in. This plug-in must be installed to interface with the catalog object. The Catalog plug-in and the catalog object is available only in Acrobat Pro.

See also the index object, which is used to invoke various indexing operations provided by the Catalog plug-in, and the CatalogJob object. Returns true when Catalog is not busy with an indexing job.

Gets information about the Catalog jobs. Catalog maintains a list of its pending, in-progress, and completed jobs for each Acrobat session. Returns an array of CatalogJob objects. Uses a specified path of a Catalog index to get an Index object. The returned object can be used to perform various indexing operations such as building or deleting an index.

Catalog maintains a list of pending, in-progress, and completed jobs for each Acrobat session. The CatalogJob object to remove, as returned by the jobs property and various methods of the Index object. This generic JavaScript object provides information about a job submitted to Catalog. It is returned by the build method of the Index object and the catalog. The Certificate object provides read-only access to the properties of an X.

DirConnection object: Search Page. The distinguished name of the issuer of the certificate, returned as an RDN object. An array of strings indicating the value of the certificate key usage extension. Possible values are. The MD5 digest of the certificate, represented as a hex-encoded string.

This provides a unique fingerprint for this certificate. Before a digital ID can be used for signing, Acrobat ensures that the signing time is prior to the privateKeyValidityEnd date. Before a digital ID can be used for signing, Acrobat ensures that the signing time is more recent than the privateKeyValidityStart date. The SHA1 digest of the certificate, represented as a hex-encoded string. A unique identifier for this certificate, used in conjunction with issuerDN.

The application rights that can be enabled by this certificate, returned as a generic Rights object. A Rights object has the following properties. Evaluation : Rights enabled by this certificate for this document are valid as long as this certificate is valid. Production : Rights enabled by this certificate for this document are valid for eternity. Array of strings indicating the application rights that can be enabled by this certificate.

Possible values are:. FormFillInAndSave : The right to fill in forms, excluding signature fields, and to save the modified file. BarcodePlaintext : The right to encode the appearance of a form field as a plain text barcode. AnnotOnline : Allow online commenting. Enables uploading of any annotations in the document to a server and downloading of annotations from a server. Does not enable the addition of these annotations into the document.

EFModify : The right to create, delete, modify, and import named embedded files. Does not apply to file attachment annotations. The purposes for which this certificate may be used within the Acrobat environment returned as a Usage object. This generic JavaScript object represents a certificate usage value in the certificate. It has the following properties.

Example: Encrypt the currently open document for everyone in the address book. Address book entries that contain sign-only certificates, CA certificates, no certificates, or are otherwise unsuitable for encryption, are not included in the final recipient list.

The validity end date of the certificate. Before a digital ID can be used for signing, Acrobat ensures that the signing time is prior to the validityEnd date. The validity start date of the certificate. Before a digital ID can be used for signing Acrobat, ensures that the signing time is more recent than the validityStart date. Adds a new state model to Acrobat.

A state model describes the valid states that an annotation using the model can have see the Annotation object for details about getting and setting the state of an annotation. State models can be used to describe the workflow that a document review goes through and can be used for review management. The display name of the state model used in the user interface.

The value should be a localized string. The states in the state model, described by a States object. The default is for there to be no default state. The default is false the State Model is shown. Keeping an audit history requires more space in the file. This generic object represents a set of states in a state model and is passed as the oStates parameter. The elements in the object literal are the unique state identifiers and the values are objects having the following properties:.

A state model can be removed with Collab. The document dirty property is preserved after this method is called and the original document is not modified. Removes a state model that was previously added by calling addStateModel. Removing a state model does not remove the state information associated with individual annotations.

If the model is removed and added again, all of the state information for the annotations is still available. A unique, language-independent identifier for the state model that was used in addStateModel. The color object is a convenience static object that defines the basic colors.

Use this object to set a property or call a method that requires a color array. The first element in the array is a string denoting the color space type. The subsequent elements are numbers that range between zero and one inclusive. For example, the color red can be represented as [\”RGB\”, 1, 0, 0]. Invalid strings or insufficient elements in a color array cause the color to be interpreted as the color black. A transparent color space indicates a complete absence of color and allows those portions of the document underlying the current field to show through.

Colors are represented by a single value—the intensity of achromatic light. In this color space, 0 is black, 1 is white, and intermediate values represent shades of gray.

For example,. Colors are represented by three values: the intensity of the red , green , and blue components in the output. RGB is commonly used for video displays, which are generally based on red, green, and blue phosphors. Colors are represented by four values, the amounts of the cyan, magenta, yellow, and black components in the output.

This color space is commonly used for color printers, where they are the colors of the inks used in four-color printing. Only cyan, magenta, and yellow are necessary, but black is generally used in printing because black ink produces a better black than a mixture of cyan, magenta, and yellow inks and because black ink is less expensive than the other inks. The color object defines the following colors. Example: This example sets the text color of the field to red if the value of the field is negative, or to black if the field value is nonnegative.

Converts the color space and color values specified by the color object to the specified color space:. Conversion to the gray color space is lossy in the same fashion that displaying a color TV signal on a black-and-white TV is lossy. Array of color values. See Color arrays.

Compares two Color Arrays to see if they are the same. The routine performs conversions, if necessary, to determine if the two colors are indeed equal for example, [\”RGB\”,1,1,0] is equal to [\”CMYK\”,0,0,1,0]. The returned object can then be modified.

The Doc object method colorConvertPage , accepts an array of these actions, against which matches are attempted until a match is found. The value of action is accessed through the constants. See the related property isProcessColor. Defines the rendering intent used to color convert the object. For a detailed description of rendering intents, please see Table 4. The value of convertIntent is accessed through the constants. Describes the color profile to which matching objects should be converted if the action is Convert.

A list of available color profiles can be obtained from the printColorProfiles property of the app object. If the matched object is to be converted and embed is true , the resulting object will have a color profile embedded in the file. Otherwise, the object will be stored as the corresponding device color space for the profile to which the object was converted. If this action is an ink action and if isProcessColor is true , the ink represents a process color, and the colorantName should be one of Cyan , Magenta , Yellow , Black , Red , Green or Blue.

The value of the matchAttributesAll property is a bitmap containing object attributes flags to be matched. A match occurs if all flags match, i.

The flags are accessed through the constants. The value of matchAttributesAll can be set by using the bitwise operators with the bit flags of constants. The value of the matchAttributesAny property is a bitmap containing object attributes to be matched. A match occurs if any of the flags match. The value of matchAttributesAny can be set by using the bitwise operators with the bit flags of constants. Matches the rendering intent used for the object.

The value of matchIntent is accessed through the constants. Use the rendering intent specified by the current graphics state in which the matched object is rendered used by convertIntent only. The value of the matchSpaceTypeAll property is a bitmap containing color space attributes flags to be matched. These two fields are bitmaps containing color space attributes to be matched. The first field will only match if all flags match, i.

The second field will match if any of the flags match. This space is RGB. This flag should only be used in combination with DeviceSpace or CalibratedSpace. This space is CMYK. This space is Grayscale. The value of matchSpaceTypeAll can be set by using the bitwise operators with the bit flags of constants. The value of the matchSpaceTypeAny property is a bitmap containing color space attributes flags to be matched.

The value of matchSpaceTypeAny can be set by using the bitwise operators with the bit flags of constants. If a CMYK color is 0. The resulting color will be as described for the matching black color for the corresponding profile target color space, for example, if the convert profile is RGB, the resulting color will be 0.

If useBlackPointCompensation is true, use black point compensation for all color conversions. The effect of this flag depends on the color management method CMM being used, but if the Adobe CMM is being used, colorimetric transforms are scaled such that black remains black no matter what the media black point of the source profile. A collection object is obtained from the Doc. The collection object is used to set the initial document in the collection, set the initial view of the collection, and to get, add, and remove collection fields or categories.

The fields property is an array of collectionField objects in the collection. Example: Enumerate all the collectionFields in a collection. Use the initialDoc property to specify the document in the collection that is initially viewed when the collection is opened. The value of initialDoc is the name property of the data object of the initial document, or null if no initial document is specified.

A string describing the initial collection view. Possible values include Tile , Details , Hidden , Custom , or null. The values of Tile and Details are built-in views, while Custom indicates that a document-based Navigator is preferred. Example: Set the initial view to Details. Adds a new field or category to the collection schema. The method throws an exception if the field already exits.

A string that is the name of the field of the collectionField object to be added. Optional A string that specifices the type of data associated with the field. Possible values are are listed below. S , a string type. A field with a string value.

D , a date type. A field with a date value. N , a numeric type. A field with a numeric value. The following values identify the types of file-related fields: F , a field reserved for the file name of a member of the collection. Desc , a field reserved for a description string of a member of the collection. Size , a ield reserved for the file size of a member of the collection.

ModDate , a field reserved for the modification date of a member of the collection. CreationDate , a field reserved for the creation date of a member of the collection.

CompressedSize , a field reserved for the compressed file size of a member of the collection. The default is \”S\” , a string type. Optional An integer that indicates the order of the field in the display of the collection in the user interface. If this parameter is not specified, the new field is listed last.

Optional A Boolean value that indicates the visibility of the field. The field is visible if the the value is true ; not visible if false. Optional A Boolean value, the field is read only if true.

If a field is read only, the user is not allowed to change the value of this field through the user interface. The collectionField object of the newly created field. Example: Create a new field in the collection called \”to\” using object literal techniques.

The getField method returns the collectionField object corresponding to the name of a collection field. A string that is the name of the field of the collectionField object to be retrieved.

A collectionField object, or null if the field is not found. Example: Get the collectionField object of the \”from\” field. Example: Remove the \”from\” field from the collection schema. The properties of the collectionField object are the fields or categories used by the collection. The text property see below is the display string the user sees in the user-interface with viewing a listing of the files files in the collection.

Use the collectionField object to set the order the fields are listed in the user-interface, the sort order of the listing of the files, or to set a field as read only. The collection field values for embedded files in the collection can be got or set through getFieldValue and setFieldValue methods of the data object. Specifies the order the field is listed in relation to other fields.

Field order is 0-based. When changing the value, if needed, the order of other fields will be incremented to prevent duplicates. A Boolean value that specifies whether the user may change values of the field in the user interface. When readonly is true , no changes are allowed. The value of sort specifies how this field contributes to the ordering of files in the collection.

If the value is 0, this field is not used to sort the files. If the absolute value is 1, this field is the primary sort field. If the absolute value is 2, the field is the secondary sort field used to break ties on the primary sort field , and so on. Additionally, the sign of value indicates the direction in which the files should be sorted.

Positive values indicate that the files are sorted in ascending order, and negative values indicate that files are sorted in descending order. Example: To illustrate the sorting scheme, consider a simple set of 4 fields that describe an email inbox: From , Subject , To , and Received. Each file in the collection represents a single email message. Set the sort order for each of these fields as indicated below:. From : 0. Subject : 1. Received : The above sort order indicates that the primary sort field is \”Subject\” the absolute value of the field is 1 and that files should be sorted in ascending order the sign is positive.

If two files have the same subject, the secondary sort field is consulted. In this case, the secondary sort field is \”Received\” the absolute value of the field is 2 and it is specified to sort in descending order. The files are sorted by Subject in ascending order. Any files that have identical Subjects will be sorted in a subgroup by their Received field, but in descending order. The other fields do not contribute to the sort, since they are 0.

The value of text specifies the display text used by the field in the user-interface. S , the value of this field is a string type. Learn more. Try the demo. Start free trial. Node js. FromFile Directory. SaveAs Directory. GetRepository Assembly. GetEntryAssembly ; XmlConfigurator. Configure logRepository, new FileInfo \”log4net.

GetLogger typeof Program ;. Build ;. Create credentials ;. See the description above of this policy for more details. Use the global object subscribe method to make the field s of interest available to others at runtime. For example, a document Document A may contain a document script invoked when that document is first opened that defines a global field value of interest:. Then, when your document Document B wants to access the value of interest from the other form Document A , it can subscribe to the variable in question:.

Beginning with version 8. For the above solution to work, the Enable Global Object Security Policy, found in the JavaScript section of the Preferences, is unchecked, or both documents must be served from the same web host.

See the previous description of this policy for more details. The new global security policy places restrictions on document access to global variables. For more information and exceptions, see Enable the global object security policy. In a document, named docA. The path for docA.

To set this global from docA. To have a document with a different path get and set this global variable, the getting and setting must occur in a trusted context, with a raised level of privilege. The following scripts are folder JavaScript. Another document, docB. The global can also be set from docB. Once global. Create a custom keystroke script see the Format tab in the Properties dialog box for any text field or combo box in which you examine the value of event.

See the discussion of the Text fields. To make a custom color, just declare an array containing the color-space type and channel values you want to use. Use the response defined in the app object.

This method displays a dialog box containing a question and an entry field for the user to reply to the question. Optionally, the dialog box can have a title or a default value for the answer to the question. If the user clicks Cancel, the response is the null object. Use the getURL method of the Doc object. If the current document is being viewed inside the browser or Acrobat Web Capture is not available, it uses the Weblink plug-in to retrieve the requested URL. You can create special rollover effects using buttons.

Create a button with the border and fill colors set to transparent, and place it where you want to detect mouse entry or exit. When the user enters or exists the button region, the JavaScript you created will execute. For example, the following is a mouse enter JavaScript action:. Suppose you have a document that contains multiple attachments, from which you would like to compile information for submission to a server in XML format. You can create a global submit button whose mouse up action contains a script that collects the data from each of the attachments and creates a unified collection in XML format.

To do this, you will need to invoke the Doc object openDataObject method in order to open the attachments, followed by its submitForm method to upload the combined XML data to the server. The following example merges the data from several XML form attachments and submits it to a server:. The accessibility of electronic information is an increasingly important issue. Creating forms that adhere to the accessibility tips below will make your forms usable by all users.

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 can 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. 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. To access the text-to-speech engine with JavaScript, use the TTS object, which has methods to render text as digital audio and present it in spoken form to the user.

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:. Returns true if the text-to-speech engine is available. Inserts a sound cue using a. Resumes playback on a paused TTS object.

Tagged files provide the greatest degree of accessibility, and are associated with a logical structure tree that supports the content. Annotations can be dynamically associated with a new structure tree that is separate from the original content of the document, thus supporting accessibility without modifying the original content.

The annotation types supported for accessibility are:. When a document is opened, saved, printed, or closed by a screen reader, the document title is spoken to the user. If the title has not been specified in the document metadata, then the file name is used. Often, file names are abbreviated or changed, so it is advised that the document author specify a title. For example, if a document has a file name of IRS Individual Income Tax Return for In addition, third-party screen readers usually read the title in the window title bar.

Providing all of the additional metadata associated with a document Author, Subject, Keywords also makes it more easily searchable using Acrobat Search and Internet search engines. Every field that is not hidden must contain a user-friendly name tooltip. The tooltip is accessible through the UI or through the Field object userName property.

For example, if a field is named name. The name should not depend on the surrounding context. For instance, if both the main section and spouse section of a document contain a First Name field, the field in the spouse section might be named Spouse\’s First Name.

This description is also displayed as a tooltip when the user positions the mouse over the field. In order to traverse the document in a reasonable manner, the tab order for the fields must be set in a logical way. This is important as most users use the tab key to move through the document. For visually impaired users, this is a necessity as they cannot rely on mouse movements or visual cues.

Pressing the tab shift-tab key when there is no form field that has the keyboard focus will cause the first last field in the tab order on the current page to become active. If there are no form fields on the page then Acrobat will inform the user of this via a speech cue. Using tab shift-tab while a field has the focus tabs forward backward in the tab order to the next previous field. If the field is the last first field on the page and the tab shift-tab key is pressed, the focus is set to the first last field on the next previous page if one exists.

The reading order of a document is determined by the Tags tree. In order for a form to be used effectively by a visually impaired user, the content and fields of a page must be included in the Tags tree. The Tags tree can also indicate the tab order for the fields on a page. As you learned earlier in Signature fields , you can lock any form fields you deem appropriate once a document has been signed. In addition, you can also encrypt a document. JavaScript provides a number of objects that support security.

These are managed by the security and securityHandler objects for building certificates and signatures, as well as the certificate , directory , SignatureInfo , and dirConnection objects which are used to access the user certificates. The certificate object provides read-only access to an X.

These objects, in combination, provide you with the means to digitally sign or encrypt a document. Once you have built a list of authorized recipients, you can then encrypt the document using the encryptForRecipients method of the Doc object, save the document to commit the encryption, and email it to them.

For example, you can obtain a list of recipients for which the encrypted document is available, and then encrypt the document:. The properties and methods of the security object are described in the following two tables. Displays a dialog box to allow a user to choose from a list of security policies, filtered according to the options. Saves a Certificate object to a local disk. Returns the list of security policies currently available, filtered according to the options specified. Reads in a Certificate object from a local disk.

Digital signature fields can be used to ensure the security of a document. The creation of a new form, whether done through the Acrobat layout tools or programmatically through JavaScript, will require that you consider the following: How the form fields will be positioned. How size, alignment, and distribution of form fields within the document will be determined. When to create multiple form fields for array-based access and algorithms.

The tab order of form fields. Acrobat form field types Form field Field type value Button button Check box checkbox Combo box combobox List box listbox Radio button radiobutton Text field text Digital signature signature You can use JavaScript to create a form field by invoking the addField method of the Doc object, which returns a Field object.

Leave a Comment

Your email address will not be published. Required fields are marked *