You
can use the PDF Utilities service Java and web service APIs to programmatically
set a save mode for a PDF document. When using the PDF Utilities
service to set a save mode, the PDF Utilities service only sets
the save mode and does not actually save the PDF document. The PDF
document is saved when it is passed to another service operation.
For example, you can use the PDF Utilities service to set a specific
save mode and pass it to the Encryption service, where the PDF document
is actually saved and encrypted.
Summary of stepsTo set the save option for PDF documents, perform the following
steps:
Include project files.
Create a PDFUtilityService client.
Set the save mode.
Invoke the save operation.
Pass the PDF document to another operation.
Include project filesInclude necessary files into your development
project. If you are creating a client application using Java, include
the necessary JAR files. If you are using web services, ensure that
you include the proxy files.
Create a PDFUtilityService clientBefore you can programmatically
perform a PDF Utilities operation, you must create a PDFUtilityService
client. With the Java API, this is accomplished by creating a PDFUtilityServiceClient object.
With the web service API, this is accomplished using a PDFUtilityServiceService object.
Set the Save modeYou can choose one of the following save
options:
INCREMENTAL: To save incrementally
to reduce the time required to save
FAST_WEB_VIEW: save for fast web viewing
FULL: To save using a full save (without
optimizations)
Invoke the save style operationAfter you create the service
client, you can invoke the properties retrieval operation.
Pass the PDF document to another LiveCycle operationOnce
the PDF Utilities service sets the specified Save mode, pass the
PDF document to another LiveCycle operation. Once returned
from that operation, the PDF document is saved in the specified
mode. For example, if you use the PDF Utilities service to set the FAST_WEB_VIEW mode
and then pass the PDF document to the Encryption service’s encryptUsingPassword operation,
the returned PDF document is encrypted with a password and save
in the FAST_WEB_VIEW mode.
注意: The
Quick Start that is associated with this section sets the FAST_WEB_VIEW mode
and then passes the PDF document to the Encryption service’s encryptUsingPassword operation.
Set PDF document save options using the Java APISet the PDF document save options by using the PDF Utilities
API (Java):
Include project files
Include client JAR files,
such as adobe-pdfutility-client.jar, in your Java project’s class
path.
Create a PDFUtilityService client
Create a PDFUtilityServiceClient object
by using its constructor and passing a ServiceClientFactory object
that contains connection properties.
Set the Save mode
Create a PDFUtilitySaveMode object
by using its constructor.
Set the save mode by invoking the PDFUtilitySaveMode object’s setSaveStyle method
and passing a string value that specifies the save mode. For example,
to save for fast web viewing, pass FAST_WEB_VIEW.
Invoke the save style operation
Invoke the PDFUtilityServiceClient object’s setSaveMode method and
pass the following values:
A com.adobe.idp.Document object
that represents the PDF document.
A PDFUtilitySaveMode object that contains
the save style to be used.
A Boolean value used to determine whether to override any
previous settings.
The method returns a com.adobe.idp.Document object
formatted using the specified save style.
Pass the PDF document to another LiveCycle operation
Set PDF document save options using the web service APISet the PDF document save options by using the PDF Utilities
AP (web service):
Include project files
Create a PDFUtilityService client
Create a PDFUtilityServiceService object
by using your proxy class constructor.
Set the Save mode
Create a PDFUtilitySaveMode object
by using its constructor.
Set the save mode by assigning a string value to the PDFUtilitySaveMode object’s saveStyle method
that specifies the save mode. For example, to save for fast web
viewing, specify FAST_WEB_VIEW.
Invoke the save style operation
Invoke the PDFUtilityServiceService object’s setSaveMode method
and pass the following values:
A BLOB object
that represents the PDF document.
A PDFUtilitySaveMode object that contains
the save style to be used.
A Boolean value used to determine whether to override any
previous settings.
The method returns a BLOB object
formatted using the specified save style. You can then save that
object as a PDF document.
Pass the PDF document to another LiveCycle operation
|
|
|