public class PsConverter extends Object 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;
| Constructor and Description |
|---|
PsConverter() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Implementation of IDisposable.
|
ResultContainer |
process(IPluginOptions options)
Starts the PsConverter processing with the specified parameters.
|
public final ResultContainer process(IPluginOptions options) throws Exception
Starts the PsConverter processing with the specified parameters.
public final void dispose()
Implementation of IDisposable.
Copyright © 2025 Aspose. All Rights Reserved.