" /> LiveCycle Doc team: August 2009 Archives

« July 2009 | Main | September 2009 »

August 28, 2009

Tips for creating form designs for Acrobat and Adobe Reader

Where to start
If you are new to Designer ES, start with one of the tutorials. If not, you can look at one of the sample forms installed with Designer ES. The sample forms illustrate form design techniques, from simple to complex. Each sample is accompanied by a form design, sample data and/or schema, as well as the final version of the form. If one of the sample forms suits your requirements, use it as a starting point. The sample forms are installed in the EN\Samples\Forms folder under the LiveCycle Designer ES installation folder.

See Quick Start Tutorials in Adobe LiveCycle Designer ES Help.


Build compatible forms
Make sure that you determine the version of Acrobat and Adobe Reader that people will use to fill the form. Setting the correct target version ensures that the form designs that you create are compatible.

See Target Version in Adobe LiveCycle Designer ES Help.


Design for reuse
Use fragments if you are planning to use the same element in multiple forms. Using fragments makes updating the common elements much easier.

See Using Fragments in Adobe LiveCycle Designer ES Help.


Consider security
You may want users to enter a password for such things as opening, printing, copying text or applying signatures. When designing interactive PDF forms it is important to ensure that your forms and the data you gather is secure. Designer ES includes many functions and features that provide security options for your forms.

See Setting Security in Adobe LiveCycle Designer ES Help.


Make forms accessible
An accessible form is one that is simple and usable. A simple layout of controls and fields with clear, meaningful captions and tool tips will make the form much easier for all users to fill.

See Creating Accessible Forms in Adobe LiveCycle Designer ES Help.


How it's done
It is easier to start with the layout of the form and then add the dynamic parts, and scripting. While designing the form, preview it often. Previewing ensures that your form designs look and behave the way you intended. Here is an example of the workflow you might use to create a form design:

Set the target version.
Set the form size and define master pages.
Add the form elements (title, header, body, footer),
Set tabbing order.
Test the form with users.

August 20, 2009

@livecycle How do I add you to my social networks?

Want to stay in touch with what's new with LiveCyle ES? You could wait for our regular press releases ... or you could become one of the LiveCycle nation and get plugged in using one of our social networking outlets. Here's the rundown:

By far the best way to stay in touch. A one-stop resource for all things LiveCycle, LiveCycle Café is an Adobe AIR application (download required) that aggregates LiveCycle news, notes, a cool live chat feature, information on upcoming events, and links to LiveCycle resources. The RSS feeds section includes the best LiveCycle blogs and other online information sources, including THIS blog (arguably the best of them all).
A community page for people to ask questions, provide answers, and generally discuss all things LiveCycle.
Straight from the source ... 140 characters or less.
Become a fan of Adobe LiveCycle ES and join the 354 (as of now) other fans online.
Join one of the LiveCycle related groups to stay connected with like-minded LiveCycle professionals.
There are a number of great blogs loaded with information for new and experienced users. Obviously the documentation blog is the best, but there are some other decent ones too.

And hey, once you're connected don't just lurk. Join in discussions, post to the forums, get on the community pages, and be an active part of the LiveCycle nation.

Have a good day.

August 14, 2009

Invoking LiveCycle ES 8.2 services using Java proxy files created using JAX-WS

Did you know that you can use JAX-WS to create Java proxy classes that consume the SOAP stack of a LiveCycle ES 8.2 service? That is correct, you have another choice when deciding how best to invoke LiveCycle ES from a Java client application.

When creating proxy classes, you do not need to include LiveCycle Java client JAR files in your Java project's class path.  For example, assume you want to invoke the Encryption service to protect a PDF document with password-based encryption.
If you were using the Java API, you would have to include the following JAR files in your class path:

1. adobe-encryption-client.jar
2. adobe-livecycle-client.jar
3. adobe-usermanager-client.jar
4. adobe-utilities.jar
5. jbossall-client.jar (use a different JAR file if LiveCycle ES2 is not deployed on JBoss)

However, when you create Java proxy classes using JAX-WS, these JAR files do not have to be placed in your Java project's class path.

Apache Ant lets you create a build script that generates Java proxy classes by referencing a LiveCycle ES service WSDL. The following is an example of a build script:

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="compile">

<property name="port" value="8080" />
<property name="host" value="localhost" />
<property name="username" value="administrator" />
<property name="password" value="password" />
<property name="tests" value="all" />

<target name="clean" >
    <delete dir="classes" />
</target>

<target name="wsdl" depends="clean">
    <mkdir dir="classes"/>
    <exec executable="wsimport" failifexecutionfails="false" failonerror="true" resultproperty="foundWSIMPORT">
        <arg line="-keep -d classes http://${host}:${port}/soap/services/EncryptionService?wsdl&amp;lc_version=8.2.1"/>
    </exec>
    <fail unless="foundWSIMPORT">
       !!! Failed to execute JDK's wsimport tool. Make sure that JDK 1.6 (or later) is on your PATH !!!
    </fail>
</target>

<target name="compile" depends="clean, wsdl" >
  <javac destdir="./classes" fork="true" debug="true">
     <src path="./src"/>
  </javac>
</target>

<target name="run">
  <java classname="Client" fork="yes" failonerror="true" maxmemory="200M">
     <classpath>
       <pathelement location="./classes"/>
     </classpath>
     <arg value="${port}"/>
     <arg value="${host}"/>
     <arg value="${username}"/>
     <arg value="${password}"/>
     <arg value="${tests}"/>
  </java>
</target>
</project>

Within this Ant build script, notice that the url property is set to reference the Encryption service WSDL running on localhost. The username and password properties must be set to a valid LiveCycle ES user name and password. Notice that the URL contains the lc_version attribute.

You can generate JAX-WS proxy files by performing the following steps:

1.    Install Apache Ant on the client computer. (See http://ant.apache.org/bindownload.cgi.)
2.    Add the bin directory to your class path.
3.    Set the ANT_HOME environment variable to the directory where you installed Ant.
4.    Install JDK 1.6 or later.
5.    Add the JDK bin directory to your class path.
6.    Add the JRE bin directory to your class path. This bin is located in the  [JDK_INSTALL_LOCATION]/jre directory.
7.    Set the JAVA_HOME environment variable to the directory where you installed the JDK. JDK 1.6 includes the wsimport program used in the build.xml file. JDK 1.5 does not include that program.
8.    Install JAX-WS on the client computer. (See Java API for XML Web Services.)
9.    Use JAX-WS and Apache Ant to generate Java proxy classes. Create an Ant build script to accomplish this task.
10.    Create a BAT file to execute the Ant build script. The following command can be located within a BAT file that is responsible for executing the Ant build script: ant -buildfile "build.xml" wsdl
11.    Place the ANT build script in the C:\Program Files\Java\jaxws-ri\bin directory. The script writes the JAVA files to the ./classes folder. The script generates JAVA files that can invoke the service.
12.    Package the JAVA files into a JAR file. If you are working on Eclipse, follow these sub steps:
 
•    Create a new Java project that is used to package the proxy JAVA files into a JAR file.
•    Create a source folder in the project.
•    Create a com.adobe.idp.services package in the Source folder.
•    Select the com.adobe.idp.services package and then import the JAVA files from the adobe/idp/services folder into the package.
•    Create an org/apache/xml/xmlsoap package in the Source folder.
•    Select the source folder and then import the JAVA files from the org/apache/xml/xmlsoap folder.
•    Set the Java compiler's compliance level to 5.0 or greater.
•    Build the project.
•    Export the project as a JAR file.
•    Import this JAR file in a client project's class path. In addition, import all of the JAR files located in <Install Directory>\Adobe\LiveCycle8.2\LiveCycle_ES_SDK\client-libs\thirdparty.

The following code example uses Java proxy files created using JAX-WS to invoke the Encryption server and encrypt a PDF document with a password.

import java.io.*;
import javax.xml.ws.BindingProvider;
import com.adobe.idp.services.*;

public class EncryptDocument {

    public static void main(String[] args) {
       
        try{
            // Setting configurations to retrieve the Web service
            String url = "http://hsmithk-380:8080/soap/services/EncryptionService?blob=base64";
            String username = "administrator";
            String password = "password";
           
            // Create the service Client objects needed
            EncryptionServiceService encryptionService = new EncryptionServiceService();
            EncryptionService encryptionClient = encryptionService.getEncryptionService();
           
            // Retrieve the Web services from the LiveCycle Server.
            ((BindingProvider) encryptionClient).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
            ((BindingProvider) encryptionClient).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
            ((BindingProvider) encryptionClient).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
           
            // Create an input Stream
            BLOB inDoc = new BLOB();
           
            // Get the input PDF document to encrypt
            File ddxFileName = new File("C:\\Adobe\\Loan.pdf");
            FileInputStream ddxFs = new FileInputStream(ddxFileName);
               
            // Get the lengths of the file streams and create byte arrays
            int ddxLen = (int)ddxFileName.length();
            byte[] ddxByteArray = new byte[ddxLen];
           
            // Populate the byte arrays with the contents of the file streams
            ddxFs.read(ddxByteArray, 0, ddxLen);
          
            inDoc.setBinaryData(ddxByteArray);

            //Create a PasswordEncryptionOptionSpec object that stores encryption run-time values
            PasswordEncryptionOptionSpec passSpec = new PasswordEncryptionOptionSpec();
           
            //Specify the PDF document resource to encrypt
            passSpec.setEncryptOption(PasswordEncryptionOption.ALL);
                       
            //Specify the Acrobat version
            passSpec.setCompatability(PasswordEncryptionCompatability.ACRO_7);
           
            //Specify the password values
            passSpec.setDocumentOpenPassword("OpenPassword");
            passSpec.setPermissionPassword("PermissionPassword");
           
            //Encrypt the PDF document
            BLOB encryptDoc = encryptionClient.encryptPDFUsingPassword(inDoc,passSpec);
           
            //Save the encrypted file as a PDF file
            byte[] encryptedDocument = encryptDoc.getBinaryData();
           
            //Create a File object
            File outFile = new File("C:\\Adobe\\EncryptedDocument.pdf");
           
            //Create a FileOutputStream object.
            FileOutputStream myFileW = new FileOutputStream(outFile);
           
            //Call the FileOutputStream object's write method and pass the pdf data
            myFileW.write(encryptedDocument);
           
            //Close the FileOutputStream object
            myFileW.close();
            System.out.println("The PDF document was encrypted with a password");   

        }catch (Exception e) {
            e.printStackTrace();
        }
    }
}

August 7, 2009

New Solution Accelerators for LiveCycle ES Released!

Earlier this week, Adobe launched another set of Solution Accelerators for LiveCycle ES, which include:

• Financial Services Account Enrollment Solution Accelerator
• Financial Services Correspondence Management Solution Accelerator
• Government Benefits & Services Delivery Solution Accelerator
• Cross-Industry Human Capital Applications Solution Accelerator

For more details, see the Solution Accelerator page on the LiveCycle Developer Center at: http://www.adobe.com/devnet/livecycle/?view=solutionaccelerators.