The SDK provides bit public headers to 3rd party plug-in developers so that they can successfully create or upgrade their plugins to bit. Overview, choosing a development methodology, differences between Acrobat and Reader, example features, FAQ.
Acrobat API Reference. Latest : PDF Reference 1. PDF Reference 1. Acrobat SDK docs. These deprecated docs do not contain the latest information, and references to Unix, LiveCycle, and legacy features have not been removed.
Caution These deprecated docs do not contain the latest information, and references to Unix, LiveCycle, and legacy features have not been removed. Snippet Runner Cookbook. Prototyping code without the overhead of writing and verifying a complete plugin or application. Distiller API Reference. PDF Creation Settings.
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.
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.
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.
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. It’s the folder path of the current document. Since the current document was just created with app. The result will look something like this:. Of course, this information is easily available in the Document Properties dialog.
In addition, you can create your own status and error messages to display here. As an example, let’s execute something that will cause an error. Enter and run the following line of code in the Console Window:. This line of code instructs Acrobat to open a file xx. Acrobat responds by generating an error, which is displayed by the Console Window, shown in Figure 8. This message is critical to understanding why the code failed, especially if the function call is buried in several lines of code inside another script.