Main

May 08, 2008

Drop-down List Samples

The "Countries" custom drop-down list object in the Custom object library in Designer only has 55 countries listed. With well over a hundred missing I thought it would be worth sharing the complete list that I had to put together for a recent project. This includes the complete UN list of countries as well as the States & Provinces in North America. Thanks to http://openconcept.ca/blog/mgifford/text_list_all_countries for the text list.

Download the sample below and then open with Designer. Once loaded, drag each of the objects from the PDF into the Custom Object Library. Once there, you will be able to drag and drop these on to any of your forms. Better yet, create Form Fragments so if any changes occur you only have to update the data in one place.

March 28, 2008

The Acrobat User Community is hosting a PDF Forms contest!

Forms creation, distribution and response tracking are one of the most popular uses for Acrobat (and LiveCycle Designer ES). But users need more samples of great forms and useful templates.

The purpose of the PDF forms contest is to create a public library of sample Forms and LiveCycle Designer templates that other PDF creators can use. The contest is open to qualified participants in any industry. You can even use a free 30-day trial copy of Acrobat 8 Professional to create your entries.

There are two entry categories:

Category: Fillable Forms
Show sophisticated and visually interesting fillable PDF Forms created using the forms toolbar in Acrobat 8 Professional, and may include interactive form elements, auto-formatting, calculations and Javascripting.

Category: LiveCycle Designer Templates
Develop form templates that can be used in LiveCycle Designer 8, and may include graphics, interactive form elements, library elements, auto-formatting, calculations and Javascripting. (LiveCycle Designer is included with every copy of Acrobat 8 Professional for Windows)

Notable entries will appear in the PDF Forms gallery. Entries may also qualify to win Adobe software, video cams and t-shirts.

The contest runs from Mar 10, 2008 until Apr 30, 2008.

Full details at http://www.acrobatusers.com/contests/forms/

January 30, 2008

Which Version of Reader?

In some cases you may want to ensure that the users filling in and submitting your forms are using the version of Reader that you designed your forms to function with. In most cases if you have developed your form with functionality that requires Reader 8.1.1 for example, and the user opens the form in Reader 7.0.9, Reader will attempt to "degrade gracefully" providing as much functionality as possible to the user. They will be notified that the form may not work as designed and that they should upgrade but they may still be able to complete and submit the form.

You can control your form programmatically by looking at the host "version".

var vCurrentVersion = 0;
vCurrentVersion = xfa.host.version;

vCurrentVersion will be equal to the version of Reader currently used. In my case, the numeric value is 8.101.

If you're curious as to whether or not Reader or Acrobat has been used to complete the form, that can also be detected.

var vApplicationName = "";
vApplicationName = xfa.host.appType;

vApplicationName will result in either 'Exchange-Pro" for Acrobat or "Reader" for Reader.

To tie the version and the logic together you'd be looking at something like this:

if(xfa.host.version >= 8.101)
{
resultText.rawValue = "Good.";
}
else
{
resultText.rawValue = "Bad.";
}

In the case of "Bad" you may want to protect the form fields or disable the submit button to ensure version compliance of your users.

January 16, 2008

Changing Script at Runtime

If you would like to experiment with Script within your PDF document, this sample shows how you can change and execute script at run-time without having to return to Designer to make the modifications. You can enter code into the script box, click the execute button, and the code will be run. Any errors will be displayed in the text box below. Quite useful when debugging different code techniques.

December 18, 2007

Filling in Forms with Sample Data

The "Fill Form" button on this sample can be dragged and dropped into your Designer Custom Object Library and reused on other forms to help populate those forms with random sample data. The script in the button simply looks through the form (xfa.form) finding each of the fields (using myNode.nodes.item(0).className) and filling in their values.

December 11, 2007

Changing a WebService Definition at Runtime

If you have webservice calls predefined in your Data View at design time, you can easily change their definitions at runtime by modifying their soapAddress value. This will allow you to dynamically change which servers or services you are using. Of course, if you do change the soapAddress you need to be certain that the input and output requirements of the services are fulfilled.

This practice is particularly useful when there is a need to change servers at runtime (i.e.: switch between your development and deployment environments without changing forms).

December 07, 2007

XPath in a PDF

This sample demonstrates how to use XPath syntax to extract the information that you need out of an XML variable. Very useful for turning a large XML dataset into smaller chunks of usable data.

If you have any samples or code that you would like to see in the future, be certain to leave a comment.