com.aspose.eps

Class PsDocument



  • public class PsDocument
    extends Document

    This class encapsulates PS/EPS documents.

    • Constructor Detail

      • PsDocument

        public PsDocument(InputStream psStream)
                   throws IOException

        Initializes PsDocument with a stream of PS/EPS file.

        Parameters:
        psStream - Stream of PS/EPS file.
        Throws:
        IOException - I/O exception.
    • Method Detail

      • setInputStream

        public void setInputStream(InputStream is)
                            throws IOException

        Specifies an input stream.

        Parameters:
        is - Input stream of PS/EPS file.
        Throws:
        IOException - I/O exception.
      • save

        public void save(Device device,
                         SaveOptions options)
                  throws Exception

        Saves PS/EPS file to a device.

        Specified by:
        save in class Document
        Parameters:
        device - An output device.
        options - Contains flags that specify output of errors thrown during conversion.
        Throws:
        Exception - Whatever exception raised during document saving.
      • save

        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.

        Parameters:
        epsStream - Stream of output EPS file.
        Throws:
        Exception
      • getXmpMetadata

        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.

        Returns:
        existing or new instance of XMP metadata.
        Throws:
        Exception
      • getNumberOfPages

        public int getNumberOfPages()

        Gets a quantity of pages in resulting PDF document.

        Returns:
        the number of pages.
      • merge

        public void merge(String[] filesForMerge,
                          Device device,
                          SaveOptions options)
                   throws Exception

        Merges PS/EPS files to a device.

        Parameters:
        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.
        Throws:
        Exception