Summary of steps

To convert any of the supported types to a PDF document, perform the following steps:

  1. Include project files.
  2. Create a Distiller service client.
  3. Retrieve the file to convert.
  4. Invoke the PDF creation operation.
  5. Save the PDF document.

Include project files

Include the necessary files in your development project. If you are creating a client application by using Java, include the necessary JAR files. If you are using web services, make sure you include the proxy files.

Create a Distiller service client

Before you can programmatically perform a Distiller service operation, you must create a Distiller service client. If you are using the Java API, create a DistillerServiceClient object. If you are using the web service API, create a DistillerServiceService object.

Retrieve the file to convert

Retrieve the file that you want to convert. For example, to convert a PS file to a PDF document, you must retrieve the PS file.

Invoke the PDF creation operation

After you create the service client, you can then invoke the PDF creation operation. This operation will need information about the document to be converted, including the path to the target document.

Save the PDF document

You can save the PDF document as a PDF file.

See also

Convert a PostScript file to PDF using the Java API

Converting a PostScript file to PDF using the web service API

Including AEM Forms Java library files

Setting connection properties

Output Service API Quick Starts

Convert a PostScript file to PDF using the Java API

Convert a PostScript file to PDF document by using the Distiller Service API (Java):

  1. Include project files.

    Include client JAR files, such as adobe-distiller-client.jar, in your Java project’s class path.

  2. Create a Distiller service client.

    • Create a ServiceClientFactory object that contains connection properties.
    • Create an DistillerServiceClient object by using its constructor and passing the ServiceClientFactory object.
  3. Retrieve the file to convert.

    • Create a java.io.FileInputStream object that represents the file to convert by using its constructor and passing a string value that specifies the location of the file.
    • Create a com.adobe.idp.Document object by using its constructor and passing the java.io.FileInputStream object.
  4. Invoke the PDF creation operation.

    Invoke the DistillerServiceClient object’s createPDF method and pass the following values:

    • The com.adobe.idp.Document object that represents the PS, EPS, or PRN file to be converted
    • A java.lang.String object that contains the name of the file to be converted
    • A java.lang.String object that contains the name of the Adobe PDF settings to be used
    • A java.lang.String object that contains the name of the security settings to be used
    • An optional com.adobe.idp.Document object that contains settings to be applied while generating the PDF document
    • An optional com.adobe.idp.Document object that contains metadata information to be applied to the PDF document

    The createPDF method returns a CreatePDFResult object that contains the new PDF document and a log file that may be generated. The log file typically contains error or warning messages that are generated by the conversion request.

  5. Save the PDF document.

    To obtain the newly created PDF document, perform the following actions:

    • Invoke the CreatePDFResult object’s getCreatedDocument method. This returns a com.adobe.idp.Document object.
    • Invoke the com.adobe.idp.Document object’s copyToFile method to extract the PDF document.

    Similarly, to obtain the log document, perform the following actions.

    • Invoke the CreatePDFResult object’s getLogDocument method. This returns a com.adobe.idp.Document object.
    • Invoke the com.adobe.idp.Document object’s copyToFile method to extract the log document.