|Language:||English, Spanish, Dutch|
|ePub File Size:||21.76 MB|
|PDF File Size:||20.19 MB|
|Distribution:||Free* [*Sign up for free]|
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: this. 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'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: this.
Suppose a document needs to be checked for branding purposes, i.
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: app.
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 Console Window has to convert the result of code execution to text before it can be displayed. Not everything has an obviously meaningful text representation. In this case, the output of the function is a Document Object. Objects are converted to text by simply converting their type information to a string.
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. Enter and run the following line of code: this. It's the folder path of the current document. Since the current document was just created with app. The advantage to using the Console Window is to make this information available to copy to the system clipboard for use with another script in Acrobat or for something else.
When something goes wrong, this error-handling system usually displays some helpful message sometimes in the Console Window, so this is the first place to look when things aren't working.
I think seeing examples in context would be useful. Sam updated my answer for 1 more thing that I remembered just now. These are the names that are used to include menu items into a script.
Bouncing Button Game A simple game of catch the moving button. Demonstrates the use PDF page geometry and timers. Which is how text and graphics are placed on a PDF page.
Nice page design by Ted Padova. Swat the Fly Simple fly killing video game. A fly buzzes around the PDF Page and you have to squish him with the cursor. Each hit leaves a dead fly in it's wake. Importing and Exporting File Attachments Sample code demonstrates importing and exporting PDF file attachments from a non-privileged context. File must be displayed in Acrobat Professional or Standard.
To help the user search the documents for specific topics all of the PDFs have been indexed and there is a custom search PDF.