API Quick Starts (Code Examples) > Rights Management Service API Quick Starts > Quick Start: Modifying a watermark using the web service API

Quick Start: Modifying a watermark using the web service API
The following web service code example modifies a watermark named Confidential by modifying the value of the opacity attribute to 80.
/*
 * Ensure that you create a .NET client assembly that uses 
 * base64 encoding. This is required to populate a BLOB 
 * object with data or retrieve data from a BLOB object.
 * 
 * For information, see "Invoking LiveCycle ES using Base64 Encoding" 
 * in Programming with LiveCycle ES
 */
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.IO;
 
namespace ModifyWatermarks
{
    class Class1
    {
        [STAThread]
        static void Main(string[] args)
        {
            try
            {
                //Create a RightsManagementServiceService object
                RightsManagementServiceService rmClient = new RightsManagementServiceService();
                rmClient.Credentials = new System.Net.NetworkCredential("administrator", "password");
 
                //Retrieve the watermark named Confidential
                WatermarkSpec watermark = rmClient.getWatermarkByName("Confidential");
 
                //Define the key/value pairs required by the Rights Management service
                ValueMapSpec valueMapSpec = new ValueMapSpec();
                valueMapSpec.key = "WaterBackCmd:IS_USERID_ENABLED";
                valueMapSpec.value = "true";
 
                //Set the text enabled property
                ValueMapSpec valueMapSpec1 = new ValueMapSpec();
                valueMapSpec1.key = "WaterBackCmd:IS_CUSTOMTEXT_ENABLED";
                valueMapSpec1.value = "True";
 
                //Set the opacity property
                ValueMapSpec valueMapSpec2 = new ValueMapSpec();
                valueMapSpec2.key = "WaterBackCmd:OPACITY";
                valueMapSpec2.value = ".80";
 
                //Set the text property
                ValueMapSpec valueMapSpec3 = new ValueMapSpec();
                valueMapSpec3.key = "WaterBackCmd:SRCTEXT";
                valueMapSpec3.value = "Confidential";
 
                //Set the watermark properties
                Object[] myObject = new Object[4];
                myObject[0] = new Object();
                myObject[1] = new Object();
                myObject[2] = new Object();
                myObject[3] = new Object();
 
                myObject[0] = (Object)valueMapSpec;
                myObject[1] = (Object)valueMapSpec1;
                myObject[2] = (Object)valueMapSpec2;
                myObject[3] = (Object)valueMapSpec3;
 
                //Assign the object array to the values data member
                watermark.values = myObject;
 
                //Register the watermark
                rmClient.updateWatermark(watermark);
            }
 
            catch (Exception ee)
            {
                Console.WriteLine(ee.Message);
            }
        }
    }
}
 
 

API Quick Starts (Code Examples) > Rights Management Service API Quick Starts > Quick Start: Modifying a watermark using the web service API

Programming with LiveCycle ES (LiveDocs)
Adobe LiveCycle ES Update 1

 

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_3.html