The following code example creates a new watermark named Confidential. The custom text attribute is set to display Confidential./** This Java Quick Start uses the following JAR files* 1. adobe-rightsmanagement-client.jar* 2. namespace.jar (if LiveCycle ES is deployed on JBoss)* 3. jaxb-api.jar (if LiveCycle ES is deployed on JBoss)* 4. jaxb-impl.jar (if LiveCycle ES is deployed on JBoss)* 5. jaxb-libs.jar (if LiveCycle ES is deployed on JBoss)* 6. jaxb-xjc.jar (if LiveCycle ES is deployed on JBoss)* 7. relaxngDatatype.jar (if LiveCycle ES is deployed on JBoss)* 8. xsdlib.jar (if LiveCycle ES is deployed on JBoss)* 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 ES is not deployed on JBoss)** These JAR files are located in the following path:* <install directory>/Adobe/LiveCycle8/LiveCycle_ES_SDK/client-libs** For complete details about the location of these JAR files,* see "Including LiveCycle ES library files" in Programming* with LiveCycle ES*/import java.util.*;import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;import com.adobe.livecycle.rightsmanagement.client.*;import com.adobe.livecycle.rightsmanagement.client.infomodel.*;public class CreateWatermarks {public static void main(String[] args) {try{//Set connection properties required to invoke LiveCycle ESProperties connectionProps = new Properties();connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://localhost:1099");connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");//Create a ServiceClientFactory instanceServiceClientFactory factory = ServiceClientFactory.createInstance(connectionProps);//Create a RightsManagementClient objectRightsManagementClient rightsClient = new RightsManagementClient(factory);//Create a Watermark objectWatermark myWatermark = InfomodelObjectFactory.createWatermark();//Set the name attributemyWatermark.setName("Confidential");//Set the background attributemyWatermark.setBackground(true);//Set the setHorizontalAlignment attributemyWatermark.setHorizontalAlignment(Watermark.HORIZONTAL_ALIGNMENT_CENTER);//Set the custom text attributemyWatermark.setCustomText("Confidential");//Set the opacity attributemyWatermark.setOpacity(80);//Register the watermarkWatermarkManager watermarkManager = rightsClient.getWatermarkManager();String waterId = watermarkManager.registerWatermark(myWatermark);System.out.println("The identifier of the registered watermark is "+waterId);}catch (Exception ex){ex.printStackTrace();}}}
| Programming with LiveCycle ES (LiveDocs) |
| Adobe LiveCycle ES Update 1 |
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000149.html
Comments
Yogesh Gandhi said on Sep 23, 2008 at 11:00 PM : smacdonald2008 said on Sep 24, 2008 at 7:31 AM :