Summary of steps
To convert any of the supported types to a PDF document, perform the following steps:
- Include project files.
- Create a Distiller service client.
- Retrieve the file to convert.
- Invoke the PDF creation operation.
- 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
Convert a PostScript file to PDF using the Java API
Convert a PostScript file to PDF document by using the Distiller Service API (Java):
-
Include project files.
Include client JAR files, such as adobe-distiller-client.jar, in your Java project’s class path.
-
Create a Distiller service client.
- Create a
ServiceClientFactoryobject that contains connection properties. - Create an
DistillerServiceClientobject by using its constructor and passing theServiceClientFactoryobject.
- Create a
-
Retrieve the file to convert.
- Create a
java.io.FileInputStreamobject 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.Documentobject by using its constructor and passing thejava.io.FileInputStreamobject.
- Create a
-
Invoke the PDF creation operation.
Invoke the
DistillerServiceClientobject’screatePDFmethod and pass the following values:- The
com.adobe.idp.Documentobject that represents the PS, EPS, or PRN file to be converted - A
java.lang.Stringobject that contains the name of the file to be converted - A
java.lang.Stringobject that contains the name of the Adobe PDF settings to be used - A
java.lang.Stringobject that contains the name of the security settings to be used - An optional
com.adobe.idp.Documentobject that contains settings to be applied while generating the PDF document - An optional
com.adobe.idp.Documentobject that contains metadata information to be applied to the PDF document
The
createPDFmethod returns aCreatePDFResultobject 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. - The
-
Save the PDF document.
To obtain the newly created PDF document, perform the following actions:
- Invoke the
CreatePDFResultobject’sgetCreatedDocumentmethod. This returns acom.adobe.idp.Documentobject. - Invoke the
com.adobe.idp.Documentobject’scopyToFilemethod to extract the PDF document.
Similarly, to obtain the log document, perform the following actions.
- Invoke the
CreatePDFResultobject’sgetLogDocumentmethod. This returns acom.adobe.idp.Documentobject. - Invoke the
com.adobe.idp.Documentobject’scopyToFilemethod to extract the log document.
- Invoke the