public class PsDocument extends Document
This class encapsulates PS/EPS documents.
Constructor and Description |
---|
PsDocument(InputStream psStream)
Initializes
PsDocument with a stream of PS/EPS file. |
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfPages()
Gets a quantity of pages in resulting PDF document.
|
XmpMetadata |
getXmpMetadata()
Reads PS/EPS file and extracts XmpMetdata if it already exists or add new one if it doesn't exist.
|
void |
merge(String[] filesForMerge,
Device device,
SaveOptions options)
Merges PS/EPS files to a device.
|
void |
save(Device device,
SaveOptions options)
Saves PS/EPS file to a device.
|
void |
save(OutputStream epsStream)
Saves given PsDocument as EPS file.
|
static void |
saveImageAsEps(BufferedImage image,
OutputStream epsStream,
PsSaveOptions options)
Saves BufferedImage object to EPS file.
|
static void |
saveImageAsEps(BufferedImage image,
String epsFilePath,
PsSaveOptions options)
Saves BufferedImage object to EPS file.
|
static void |
saveImageAsEps(InputStream imageStream,
OutputStream epsStream,
PsSaveOptions options)
Saves PNG/JPEG/BMP/GIF image from input stream to EPS output stream.
|
static void |
saveImageAsEps(String imageFilePath,
String epsFilePath,
PsSaveOptions options)
Saves PNG/JPEG/BMP/GIF image from file to EPS file.
|
void |
setInputStream(InputStream is)
Specifies an input stream.
|
isLicensed
public PsDocument(InputStream psStream) throws IOException
Initializes PsDocument
with a stream of PS/EPS file.
psStream
- Stream of PS/EPS file.IOException
- I/O exception.public void setInputStream(InputStream is) throws IOException
Specifies an input stream.
is
- Input stream of PS/EPS file.IOException
- I/O exception.public void save(Device device, SaveOptions options) throws Exception
Saves PS/EPS file to a device.
public void save(OutputStream epsStream) throws Exception
Saves given PsDocument as EPS file. This method is used only after updating XMP metadata. It saves initial EPS file with updated existing metadata or new one created while calling getMetadata method. In the last case all necessary PostScript code and EPS comments are added.
epsStream
- Stream of output EPS file.Exception
public XmpMetadata getXmpMetadata() throws Exception
Reads PS/EPS file and extracts XmpMetdata if it already exists or add new one if it doesn't exist.
Exception
public static void saveImageAsEps(InputStream imageStream, OutputStream epsStream, PsSaveOptions options) throws Exception
Saves PNG/JPEG/BMP/GIF image from input stream to EPS output stream.
imageStream
- Image input stream.epsStream
- EPS output stream.options
- Contains parameters that specify output of errors thrown during conversion.Exception
public static void saveImageAsEps(String imageFilePath, String epsFilePath, PsSaveOptions options) throws Exception
Saves PNG/JPEG/BMP/GIF image from file to EPS file.
imageFilePath
- Image file path.epsFilePath
- EPS file path.options
- Contains parameters that specify output of errors thrown during conversion.Exception
public static void saveImageAsEps(BufferedImage image, String epsFilePath, PsSaveOptions options) throws Exception
Saves BufferedImage object to EPS file.
image
- The Image.epsFilePath
- EPS file path.options
- Contains parameters that specify output of errors thrown during conversion.Exception
public static void saveImageAsEps(BufferedImage image, OutputStream epsStream, PsSaveOptions options) throws Exception
Saves BufferedImage object to EPS file.
image
- The Image.epsStream
- EPS output stream.options
- Contains parameters that specify output of errors thrown during conversion.Exception
public int getNumberOfPages()
Gets a quantity of pages in resulting PDF document.
public void merge(String[] filesForMerge, Device device, SaveOptions options) throws Exception
Merges PS/EPS files to a device.
filesForMerge
- PS/EPS files for merging with this file to an output device.device
- An output device.options
- Contains flags that specify output of errors thrown during conversion.Exception
Copyright © 2022 Aspose. All Rights Reserved.