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.
|
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 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.