com.adobe.livecycle.output.client
Class OutputClient

java.lang.Object
  extended by com.adobe.livecycle.output.client.OutputClient

public class OutputClient
extends java.lang.Object

Allows the creation of a Java object that invokes operations that belong to the Output service. Using this object, you can create document output streams using a form design and data to merge with the form design. For example, you can reference an existing form design and generate a print stream, such as one of the following formats:

For a complete list of print streams, see the PrintFormat enumeration value.

You can send the output stream to one of the following destinations: a network printer, a LPR printer, or to a network file. For information, see the Creating Document Output Streams section in Programming with Adobe Experience Manager forms.


Constructor Summary
OutputClient(ServiceClientFactory serviceClientFactory)
          A constructor that creates an OutputClient object.
 
Method Summary
 OutputResult generatePDFOutput(TransformationFormat transformationFormat, java.lang.String form, java.lang.String contentRoot, PDFOutputOptionsSpec pdfOutputOptionsSpec, RenderOptionsSpec renderOptionsSpec, Document inDataDoc)
          Generates a PDF or a PDF/A output stream given a form design and data to merge with the form design.
 OutputResult generatePDFOutput2(TransformationFormat transformationFormat, java.lang.String contentRoot, Document inFormDoc, PDFOutputOptionsSpec pdfOutputOptionsSpec, RenderOptionsSpec renderOptionsSpec, Document inDataDoc)
          Generates a PDF or a PDF/A output stream given a form design and data to merge with the form design.
 OutputResult generatePrintedOutput(PrintFormat printFormat, java.lang.String form, java.lang.String contentRoot, java.lang.String XDCURI, PrintedOutputOptionsSpec printedOutputOptionsSpec, Document inDataDoc)
          Generates a PCL, PostScript, or ZPL output stream given a form design and data to merge with the form design.
 OutputResult generatePrintedOutput2(PrintFormat printFormat, java.lang.String contentRoot, Document inFormDoc, java.lang.String XDCURI, PrintedOutputOptionsSpec printedOutputOptionsSpec, Document inDataDoc)
          Generates a PCL, PostScript, or ZPL output stream given a form design and data to merge with the form design.
 Document getResult(java.lang.String requestId)
          Deprecated.  
 boolean isSynchronous()
          For internal use only.
 void lprPrint(Document inDataDoc, java.lang.String lpdURI, java.lang.String printerQueueName)
          Deprecated. Use sendToPrinter.
 void print(Document inDataDoc, java.lang.String printUri)
          Deprecated. Use sendToPrinter.
 void resetCache()
          Exposes the Reset Cache functionality for an Output administrator as an API operation.
 java.lang.Boolean sendToPrinter(Document inDoc, PrinterProtocol printerProtocol, java.lang.String printServer, java.lang.String printerName)
          Prints the document at the given printer on the specified print server.
 void setSynchronous(boolean synchronous)
          Sets the Output service to be invoked synchronously.
 Document transformPDF(Document inPdfDoc, TransformationFormat transformationFormat, PDFARevisionNumber pdfaRevisionNumber, java.lang.String pdfaAmendment, PDFAConformance pdfaConformance)
          Converts a document output stream to either non-interactive PDF or PDF/A format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputClient

public OutputClient(ServiceClientFactory serviceClientFactory)
A constructor that creates an OutputClient object.

Parameters:
serviceClientFactory - A ServiceClientFactory object that contains connection properties. For information about setting connection properties, see the Invoking Adobe Experience Manager forms Services using APIs section in Programming with Adobe Experience Manager forms.
Method Detail

isSynchronous

public boolean isSynchronous()
For internal use only.


setSynchronous

public void setSynchronous(boolean synchronous)
Sets the Output service to be invoked synchronously. A synchronous request is blocked until the Output service finishes processing the request and returns the result back to the caller.

Parameters:
synchronous - A Boolean value that specifies whether the Output service is invoked synchronously.

generatePDFOutput

public OutputResult generatePDFOutput(TransformationFormat transformationFormat,
                                      java.lang.String form,
                                      java.lang.String contentRoot,
                                      PDFOutputOptionsSpec pdfOutputOptionsSpec,
                                      RenderOptionsSpec renderOptionsSpec,
                                      Document inDataDoc)
                               throws OutputException,
                                      com.adobe.idp.dsc.DSCException
Generates a PDF or a PDF/A output stream given a form design and data to merge with the form design. To see this method used in a code example, see the Creating a PDF document using the Java API quick start in Programming with Adobe Experience Manager forms.

Parameters:
transformationFormat - A TransformationFormat enumeration value that specifies whether to create a PDF or a PDF/A output stream.
form - The name of the form design on which the PDF or a PDF/A output stream is based on. This parameter references a form design that is saved as an XDP file and created in Adobe Experience Manager forms Designer. It can also be saved as a PDF file. For information, see the Adobe Experience Manager forms Designer Help.
contentRoot - A string value that defines the path to the form design and related collateral files.
pdfOutputOptionsSpec - A PDFOutputOptionsSpec object that contains run-time values that are used by the Output service. For example, to write a PDF or PDF/A output stream to the local file system as a PDF file, you must set the file URI by using the setFileURI() method.
renderOptionsSpec - A RenderOptionsSpec object that contains rendering options.
inDataDoc - A Document object that represents XML data used to prepopulate a form design (prepopulating a form means merging data with the form design).
Returns:
An OutputResult object that contains the results of the operation. If this operation was successful, then the actions defined using the PDFOutputOptionsSpec parameter are performed.
Throws:
OutputException - If an error occurs during this operation. For example, if the Output service cannot locate the specified form design.
com.adobe.idp.dsc.DSCException - If a run-time error occurs.

generatePDFOutput2

public OutputResult generatePDFOutput2(TransformationFormat transformationFormat,
                                       java.lang.String contentRoot,
                                       Document inFormDoc,
                                       PDFOutputOptionsSpec pdfOutputOptionsSpec,
                                       RenderOptionsSpec renderOptionsSpec,
                                       Document inDataDoc)
                                throws OutputException,
                                       com.adobe.idp.dsc.DSCException
Generates a PDF or a PDF/A output stream given a form design and data to merge with the form design. When invoking this method, a form design is passed to the Output service within a com.adobe.idp.Document object.

To see this method used in a code example, see the Passing documents to the Output Service using the Java API quick start in Programming with Adobe Experience Manager forms.

Parameters:
transformationFormat - A TransformationFormat enumeration value that specifies whether to create a PDF or a PDF/A output stream.
contentRoot - A string value that defines the path to the form design and related collateral files.
inFormDoc - A com.adobe.idp.Document object that represents the form design on which the PDF or a PDF/A output stream is based on. This parameter is a form that is saved as an XDP file and created in Adobe Experience Manager forms Designer. It can also be saved as a PDF file.
pdfOutputOptionsSpec - A PDFOutputOptionsSpec object that contains run-time values that are used by the Output service. For example, to write a PDF or PDF/A output stream to the local file system as a PDF file, you must set the file URI by using the setFileURI() method.
renderOptionsSpec - A RenderOptionsSpec object that contains rendering options.
inDataDoc - A com.adobe.idp.Document object that represents XML data used to prepopulate a form design (prepopulating a form means merging data with the form design).
Returns:
An OutputResult object that contains the results of the operation. If this operation was successful, then the actions defined using the PDFOutputOptionsSpec parameter are performed.
Throws:
OutputException - If an error occurs during this operation. For example, if the Output service cannot locate the specified form design.
com.adobe.idp.dsc.DSCException - If a run-time error occurs.

generatePrintedOutput

public OutputResult generatePrintedOutput(PrintFormat printFormat,
                                          java.lang.String form,
                                          java.lang.String contentRoot,
                                          java.lang.String XDCURI,
                                          PrintedOutputOptionsSpec printedOutputOptionsSpec,
                                          Document inDataDoc)
                                   throws OutputException,
                                          com.adobe.idp.dsc.DSCException
Generates a PCL, PostScript, or ZPL output stream given a form design and data to merge with the form design. The generated output stream can be sent to a printer by invoking the sendToPrinter method. To see this method used in a code example, see the Printing to a file using the Java API quick start in Programming with Adobe Experience Manager forms.

Parameters:
printFormat - A PrintFormat enumeration value that specifies whether to create a PCL, PostScript, or ZPL output stream.
form - The name of the form design on which the output stream is based on. This parameter references a form design that is saved as an XDP file and created in Adobe Experience Manager forms Designer. For information, see Adobe Experience Manager forms Designer Help.
contentRoot - A string value that defines the path to related collateral files.
XDCURI - A string value that defines the path to the XDC file.
printedOutputOptionsSpec - A PrintedOutputOptionsSpec object that contains run-time values that are used by the Output service.
inDataDoc - A Document object that represents XML data used to prepopulate a form design (prepopulating a form means merging data with the form design).
Returns:
An OutputResult object that contains the results of the operation.
Throws:
OutputException - If an error occurs during this operation. For example, if the Output service cannot locate the specified form design.
com.adobe.idp.dsc.DSCException - If a run-time error occurs.

generatePrintedOutput2

public OutputResult generatePrintedOutput2(PrintFormat printFormat,
                                           java.lang.String contentRoot,
                                           Document inFormDoc,
                                           java.lang.String XDCURI,
                                           PrintedOutputOptionsSpec printedOutputOptionsSpec,
                                           Document inDataDoc)
                                    throws OutputException,
                                           com.adobe.idp.dsc.DSCException
Generates a PCL, PostScript, or ZPL output stream given a form design and data to merge with the form design. The generated output stream can be sent to a printer by invoking the sendToPrinter method. When invoking this method, a form design is passed to the Output service within a com.adobe.idp.Document object.

Parameters:
printFormat - A PrintFormat enumeration value that specifies whether to create a PCL, PostScript, or ZPL output stream.
contentRoot - A string value that defines the path to related collateral files.
inFormDoc - A com.adobe.idp.Document object that represents the form design on which the output stream is based on. This parameter is a form that is saved as an XDP file and created in Adobe Experience Manager forms Designer. It can also be saved as a PDF file. For information, see the Adobe Experience Manager forms Designer Help.
XDCURI - A string value that defines the path to the XDC file.
printedOutputOptionsSpec - A PrintedOutputOptionsSpec object that contains run-time values that are used by the Output service.
inDataDoc - A Document object that represents XML data used to prepopulate a form design (prepopulating a form means merging data with the form design).
Returns:
An OutputResult object that contains the results of the operation.
Throws:
OutputException - If an error occurs during this operation. For example, if the Output service cannot locate the specified form design.
com.adobe.idp.dsc.DSCException - If a run-time error occurs.

getResult

@Deprecated
public Document getResult(java.lang.String requestId)
                   throws OutputException,
                          com.adobe.idp.dsc.DSCException
Deprecated. 

Retrieves the result of the Output service operation.

Parameters:
requestId - The request identifier value.
Returns:
The result of an operation.
Throws:
OutputException
com.adobe.idp.dsc.DSCException

print

@Deprecated
public void print(Document inDataDoc,
                             java.lang.String printUri)
           throws OutputException,
                  com.adobe.idp.dsc.DSCException
Deprecated. Use sendToPrinter.

Sends the document output stream to the specified printer. This method sends the content located in the inDataDoc parameter to the printer. If you want to send a PCL, PostScript, or ZPL output stream to a network printer, then use the generatePrintedOutput() method.

Parameters:
inDataDoc - A Document object that contains a document output stream to send to the specified printer.
printUri - A URI location of the printer to which the output stream is sent.
Throws:
OutputException - If an error occurs during this operation. For example, if you specify an invalid printer URI location.
com.adobe.idp.dsc.DSCException - If a run-time error occurs.

lprPrint

@Deprecated
public void lprPrint(Document inDataDoc,
                                java.lang.String lpdURI,
                                java.lang.String printerQueueName)
              throws OutputException,
                     com.adobe.idp.dsc.DSCException
Deprecated. Use sendToPrinter.

Prints the document at the specified Line Printer Daemon (LPD) URI when the network has a LP daemon running. This enables you to route the print job to any printer connected to the network that has a LP daemon running without requiring the printer to be installed on the machine from which the print job is initialized.

Parameters:
inDataDoc - A Document object to be printed at the specified LPD URI.
lpdURI - A string value that represents the LPD URI.
printerQueueName - The name of the printer queue.
Throws:
OutputException - If an error occurs during this operation. For example, if you specify an invalid LPD URI value.
com.adobe.idp.dsc.DSCException - If a run-time error occurs.

sendToPrinter

public java.lang.Boolean sendToPrinter(Document inDoc,
                                       PrinterProtocol printerProtocol,
                                       java.lang.String printServer,
                                       java.lang.String printerName)
                                throws OutputException,
                                       com.adobe.idp.dsc.DSCException
Prints the document at the given printer on the specified print server. A print server is only required when the CUPS and LPD print protocols are used.

To see this method used in a code example, see the Sending Print Streams to Printers using the Java API quick start in Programming with Adobe Experience Manager forms.

Parameters:
inDoc - A Document object that contains data to send to the printer.
printerProtocol - A PrinterProtocol enumeration value that specifies the printer protocol to use.
printServer - A string value that represents the print server.
printerName - The name of the printer.
Returns:
false if Shared Printer was not found
Throws:
OutputException - If an error occurs during this printing operation.
com.adobe.idp.dsc.DSCException - If a run-time error occurs, such as the Output service not being able to locate the specified network printer.

transformPDF

public Document transformPDF(Document inPdfDoc,
                             TransformationFormat transformationFormat,
                             PDFARevisionNumber pdfaRevisionNumber,
                             java.lang.String pdfaAmendment,
                             PDFAConformance pdfaConformance)
                      throws OutputException,
                             com.adobe.idp.dsc.DSCException
Converts a document output stream to either non-interactive PDF or PDF/A format. The PDF/A value specifies a W3C Archive Standard PDF/A document that can be used for archiving purposes. This value embeds all of the fonts as well as turns off compression. As a result, a PDF/A document is generally much larger than a standard PDF document. When you select the PDF/A value, you must provide values for the pdfaRevisionNumber, pdfaAmendment, and pdfaConformance parameters. Otherwise, you can specify null for these parameters.

To see this method used in a code example, see the Transforming a PDF document using the Java API quick start in Programming with Adobe Experience Manager forms.

Parameters:
inPdfDoc - A Document object that contains an output stream to convert.
transformationFormat - Specifies the format to which the output stream is converted. Valid values are PDF or PDF/A.
pdfaRevisionNumber - An integer value that specifies the revision number of the PDF/A document. The default value is Revision_1.
pdfaAmendment - A string value that represents the amendment number and year, separated by a colon.
pdfaConformance - A string value that specifies the PDF/A conformance level as specified in the PDF/A-1 ISO specification. The conformance level refers to how a PDF document adheres to requirements that specify how long-term electronic documents are preserved. Valid values are A or B. The default value is A. For information about level A and B conformance, see the PDF/A-1 ISO specification that is titled ISO 19005-1 Document management.
Returns:
A Document object that contains the results of this operation.
Throws:
OutputException - If an error occurred during this operation.
com.adobe.idp.dsc.DSCException

resetCache

public void resetCache()
                throws OutputException,
                       com.adobe.idp.dsc.DSCException
Exposes the Reset Cache functionality for an Output administrator as an API operation. This method deletes all the Cached Entries from the Disk and In-Memory Caches used by Output service. This method can only be accessed by a user having the PERM_OUTPUT_ADMIN permission.

Throws:
OutputException - Contains the root exception.
com.adobe.idp.dsc.DSCException