PsConverter
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.page.plugins.IPlugin
public class PsConverter implements IPlugin
Represents PsConverter plugin.
The example demonstrates how to convert PS/EPS file to PDF document.
// create PsConverter PsConverter converter = new PsConverter(); // create PsConverterToPdfOptions object to set output data type as file PsConverterToPdfOptions opt = new PsConverterToPdfOptions(); // add input file path opt.addDataSource(new FileDataSource(inputPath)); // set output file path opt.addSaveDataSource(new FileDataSource(outputPath)); // launch conversion process ResultContainer results = converter.process(opt);
The example demonstrates how to convert PS/EPS file to image with file output.
// create PsConverter PsConverter converter = new PsConverter(); // create PsConverterToImageOptions with JPEG target image format. The default image format for resulting image is PNG. // Also we can set a size of the resulting image, a resolution, a smoothing mode and JPEG quality level for JPEG resulting image format. PsConverterToImageOptions opt = new PsConverterToImageOptions(ImageFormat.Jpeg); // add input file path opt.addDataSource(new FileDataSource(inputPath)); // if input PS file is multipaged the results will be a set of image files with name: [“outputPath” without extension][pageNumber started from 0].[extension from “outputPath”] opt.addSaveDataSource(new FileDataSource(outputPath)); // launch conversion process converter.process(opt);
The example demonstrates how to convert PS/EPS file to image with bytes arrays output.
In the bytes arrays output datasource (byte [][]) one bytes array contains an image of one page. Thus, for one-paged documents the result will contain [1][] array, for multi-paged documents the result will contain [number of pages in input PS document][] array. // create PsConverter PsConverter converter = new PsConverter(); // create PsConverterToImageOptions with JPEG target image format. The default image format for resulting image is PNG. // Also we can set a size of the resulting image, a resolution, a smoothing mode and JPEG quality level for JPEG resulting image format. PsConverterToImageOptions opt = new PsConverterToImageOptions(ImageFormat.Jpeg); // add input file path opt.addDataSource(new FileDataSource(inputPath)); // if input PS file is multipaged the results will be a set of image files with name: [“outputPath” without extension][pageNumber started from 0].[extension from “outputPath”] opt.addSaveDataSource(new ByteArrayDataSource()); // launch conversion process converter.process(opt); // get resulting bytes arrays byte[][] imagesBytes = (byte [][]) ((ByteArrayResult)results.ResultCollection[0]).Data;
Constructors
Constructor | Description |
---|---|
PsConverter() |
Methods
Method | Description |
---|---|
dispose() | Implementation of IDisposable. |
equals(Object arg0) | |
getClass() | |
hashCode() | |
notify() | |
notifyAll() | |
process(IPluginOptions options) | Starts the PsConverter processing with the specified parameters. |
toString() | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
PsConverter()
public PsConverter()
dispose()
public final void dispose()
Implementation of IDisposable.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
process(IPluginOptions options)
public final ResultContainer process(IPluginOptions options)
Starts the PsConverter processing with the specified parameters.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IPluginOptions | An options object containing instructions for the PsConverter. |
Returns: ResultContainer - An ResultContainer object containing the result of the operation.
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |