To convert a PDF document to a PostScript file, perform
the following steps:
Include project files.
Create a Convert PDF service client.
Reference the PDF document to convert to a PostScript file.
Set conversion run-time options.
Convert the PDF document to a PostScript file.
Save the PostScript file.
Include project files
Include the necessary files into 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 Convert PDF client
Before you can programmatically perform
a Convert PDF service operation, you must create a Convert PDF service
client. If you are using the Java API, create a ConvertPdfServiceClient object.
If you are using the web service API, create a ConvertPDFServiceService object.
This
section uses web service functionality that is introduced in LiveCycle.
To access new functionality, you have to construct your proxy object using
the lc_version attribute. (See “Accessing new functionality
using web services” in Invoking LiveCycle using Web Services.)
Reference the PDF document to convert to a PostScript file
Reference
the PDF document that you want to convert to a PostScript file.
As stated earlier in this topic, the PDF document must be a non-interactive
PDF document. If you attempt to convert an interactive PDF document
to a PostScript file, an exception is thrown.
Set conversion run-time options
When converting a PDF document
to a PostScript file, you can define run-time options that specify
the PostScript type that is created. For example, you can define
a level 3 PostScript file.
Typically, the generated PostScript
file will reflect the size of input PDF document. If you select
the ShrinkToFit option (which shrinks the output
of the PostScript file to fit the page), you will not see a difference
between the input PDF document and the generated PostScript file. The ShrinkToFit option
takes effect only if you select to print on a smaller page size
than the input PDF document. To select a smaller page size, define
the PageSize option. In addition, it is recommended
that you set the RotateAndCenter option to true to
obtain the correct PostScript output.
Likewise, if you select
the ExpandToFit option (which expands the output
of the PostScript file to fit the page), it takes effect only if
you select to print on a larger page size than the input PDF document.
To select a larger page size, define the PageSize option.
In addition, it is recommended that you set the RotateAndCenter option
to true to obtain the correct PostScript output.
Note: For information about the run-time values that
you can set, see the
ToPSOptionsSpec class reference
in
LiveCycle API Reference.
Convert the PDF document to a PostScript file
After you create
the service client and set run-time options, you can invoke the
PostScript conversion operation. This operation will need information
about the document to convert, including the preferred PostScript
level for the target document.
Save the PostScript file
After you convert the PDF document
to PostScript, you can save the output as a PostScript file.