Watermarks
help ensure the security of a document by uniquely identifying the document
and controlling copyright infringement. For example, you can create and
place a watermark that states Confidential on all pages of a document.
After a watermark is created, you can include it as part of a policy.
That is, you can set the policy’s watermark attribute with the newly
created watermark. After a policy that contains a watermark is applied
to a document, the watermark appears in the policy-protected document.
注意: Only users with Rights Management administrative
privileges can create watermarks. That is, you must specify such
a user when defining connection settings required to create a Rights
Management service client object.
Summary of stepsTo
create a watermark, perform the following steps:
Include project files.
Create a Rights Management Client API object.
Set the watermarks attributes.
Register the watermark with the Rights Management service.
Include project filesInclude necessary files into your development
project. If you are creating a client application using Java, then
include the necessary JAR files. If you are using web services,
then make sure that you include the proxy files.
Create a Rights Management Client API objectBefore you can programmatically
perform a Rights Management service operation, you must create a
Rights Management service client object. If you are using the Java
API, create a RightsManagementClient object. If
you are using the Rights Management web service API, create a RightsManagementServiceService object.
Set the watermarks attributesTo create a new watermark, you
must set watermark attributes. The name attribute must always be
defined. In addition to the name attribute, you must set at least
one of the following attributes:
Custom Text
DateIncluded
UserIdIncluded
UserNameIncluded
The following table lists
key and value pairs that are required when creating a watermark
using web services.
Key Name
|
Description
|
Value
|
WaterBackCmd:IS_USERNAME_ENABLED
|
Specifies if the user name of the user opening
the document is part of the watermark.
|
True or False
|
WaterBackCmd:IS_USERID_ENABLED
|
Specifies if the identification of the user opening
the document is part of the watermark.
|
True or False
|
WaterBackCmd:IS_CURRENTDATE_ENABLED
|
Specifies if the current date is part of
the watermark.
|
True or False
|
WaterBackCmd:IS_CUSTOMTEXT_ENABLED
|
If this value is true, then the value of
the custom text must be specified using WaterBackCmd:SRCTEXT.
|
True or False
|
WaterBackCmd:OPACITY
|
Specifies the opacity of the watermark.
The default value is 0.5 if it is not specified.
|
A value between 0.0 and 1.0.
|
WaterBackCmd:ROTATION
|
Specifies the rotation of the watermark.
The default value is 0 degrees.
|
A value between 0 and 359.
|
WaterBackCmd:SCALE
|
If this value is specified, then WaterBackCmd:IS_SIZE_ENABLED must be
present and the value must be true. If this attribute is not specified,
the default behavior is fit to page.
|
A value greater than 0.0 and less than or
equal to 1.0.
|
WaterBackCmd:HORIZ_ALIGN
|
Specifies the watermark’s horizontal alignment.
The default value is center.
|
left, center, or right
|
WaterBackCmd:VERT_ALIGN
|
Specifies the watermark’s vertical alignment. The
default value is center.
|
top, center, or bottom
|
WaterBackCmd:IS_USE_BACKGROUND
|
Specifies if the watermark is a background. The
default value is false.
|
True or False
|
WaterBackCmd:IS_SIZE_ENABLED
|
True if a custom scale is specified. If
this value is true, SCALE must also be specified. If this value
is false, then the default is fit to page.
|
True or False
|
WaterBackCmd:SRCTEXT
|
Specifies the custom text for a watermark.
If this value is present, then WaterBackCmd:IS_CUSTOMTEXT_ENABLED must
also be present and set to true.
|
True or False
|
All watermarks must have one of the following
attributes defined:
WaterBackCmd:IS_USERNAME_ENABLED
WaterBackCmd:IS_USERID_ENABLED
WaterBackCmd:IS_CURRENTDATE_ENABLED
WaterBackCmd:IS_CUSTOMTEXT_ENABLED
All
other attributes are optional.
Register the watermarkA new watermark must be registered with
the Rights Management service before it can be used. After you register
a watermark, you can use it within policies.
Create watermarks using the Java APICreate a watermark by using the Rights Management API (Java):
Include project files.
Include client JAR files,
such as the adobe-rightsmanagement-client.jar, in your Java project’s
class path.
Create a Rights Management Client API object.
Set the watermark attributes
Create a Watermark object
by invoking the InfomodelObjectFactory object’s
static createWatermark method. This method returns
a Watermark object.
Set the watermark’s name attribute by invoking the Watermark object’s setName method
and passing a string value that specifies the policy name.
Set the watermark’s background attribute by invoking the Watermark object’s setBackground method
and passing true. By setting this attribute, the
watermark appears in the background of the document.
Set the watermark’s custom text attribute by invoking the Watermark object’s setCustomText method
and passing a string value that represents the watermark’s text.
Set the watermark’s opacity attribute by invoking the Watermark object’s setOpacity method
and passing an integer value that specifies the opacity level. A
value of 100 indicates the watermark is completely opaque and a
value of 0 indicates the watermark is completely transparent.
Register the watermark.
Create a WatermarkManager object
by invoking the RightsManagementClient object’s getWatermarkManager method.
This method returns a WatermarkManager object.
Register the watermark by invoking the WatermarkManager object’s registerWatermark method
and passing the Watermark object that represents
the watermark to register. This method returns a string value that
represents the watermark’s identification value.
Create watermarks using the web service APICreate a watermark by using the Rights Management API (web
service):
Create a Rights Management Client API object.
Create
a Microsoft .NET project that uses MTOM. Ensure that you use the following
WSDL definition: http://localhost:8080/soap/services/RightsManagementService?WSDL&lc_version=9.0.1.
注意: Replace localhost with the IP
address of the server hosting LiveCycle.
Create a Rights Management Client API object.
Create a RightsManagementServiceClient object
by using its default constructor.
Create a RightsManagementServiceClient.Endpoint.Address object by
using the System.ServiceModel.EndpointAddress constructor.
Pass a string value that specifies the WSDL to the LiveCycle service (for example, http://localhost:8080/soap/services/RightsManagementService?WSDL.)
You do not need to use the lc_version attribute. This
attribute is used when you create a service reference.)
Create a System.ServiceModel.BasicHttpBinding object
by getting the value of the RightsManagementServiceClient.Endpoint.Binding field. Cast
the return value to BasicHttpBinding.
Set the System.ServiceModel.BasicHttpBinding object’s MessageEncoding field
to WSMessageEncoding.Mtom. This value ensures that
MTOM is used.
Enable basic HTTP authentication by performing the following
tasks:
Assign the LiveCycle user name to the
field RightsManagementServiceClient.ClientCredentials.UserName.UserName.
Assign the corresponding password value to the field RightsManagementServiceClient.ClientCredentials.UserName.Password.
Assign the constant value HttpClientCredentialType.Basic to the
field BasicHttpBindingSecurity.Transport.ClientCredentialType.
Assign the constant value BasicHttpSecurityMode.TransportCredentialOnly to
the field BasicHttpBindingSecurity.Security.Mode.
Set the watermark attributes.
Create a WatermarkSpec object
by invoking the WatermarkSpec constructor.
Set the watermark’s name by assigning a string value to the WatermarkSpec object’s name data
member.
Set the watermark’s id attribute by assigning
a string value to the WatermarkSpec object’s id data
member.
For each watermark property to set, create a separate MyMapOf_xsd_string_To_xsd_anyType_Item object.
Set the key value by assigning a value to the MyMapOf_xsd_string_To_xsd_anyType_Item object’s key data member
(for example, WaterBackCmd:OPACITY).
Set the value by assigning a value to the MyMapOf_xsd_string_To_xsd_anyType_Item object’s value data
member (for example, .25).
Create a MyArrayOf_xsd_anyType object. For
each MyMapOf_xsd_string_To_xsd_anyType_Item object,
invoke the MyArrayOf_xsd_anyType object’s Add method.
Pass the MyMapOf_xsd_string_To_xsd_anyType_Item object.
Assign the MyArrayOf_xsd_anyType object
to the WatermarkSpec object’s values data
member.
Register the watermark.
Register the watermark by
invoking the RightsManagementServiceClient object’s registerWatermark method
and passing the WatermarkSpec object that represents
the watermark to register.
|
|
|