Interface Document

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String TYPE_PDF  
      static java.lang.String TYPE_POSTSCRIPT  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void append​(Document document)
      Append pages of another document to the current document.
      java.util.List<Document> explode()
      Separate each pages to a new document.
      Document extract​(int begin, int end)
      Return a new document containing pages of a given range.
      byte[] getContent()
      Return document content as a byte array
      int getPageCount()
      Return document page count
      int getSize()
      Return document size
      java.lang.String getType()
      Return the type of the document.
      void load​(java.io.File file)
      Load document from a File.
      void load​(java.io.InputStream inputStream)
      Load document from an InputStream.
      void write​(java.io.File file)
      Write document to a File.
      void write​(java.io.OutputStream outputStream)
      Write document to an OutputStream
    • Method Detail

      • load

        void load​(java.io.File file)
           throws java.io.FileNotFoundException,
                  java.io.IOException
        Load document from a File.
        Parameters:
        file - File.
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • load

        void load​(java.io.InputStream inputStream)
           throws java.io.IOException
        Load document from an InputStream.
        Parameters:
        inputStream -
        Throws:
        java.io.IOException
      • write

        void write​(java.io.File file)
            throws java.io.IOException
        Write document to a File.
        Parameters:
        file - File.
        Throws:
        java.io.IOException
      • write

        void write​(java.io.OutputStream outputStream)
            throws java.io.IOException
        Write document to an OutputStream
        Parameters:
        outputStream -
        Throws:
        java.io.IOException
      • getType

        java.lang.String getType()
        Return the type of the document.
        Returns:
        A String representing the document type name.
      • getSize

        int getSize()
        Return document size
        Returns:
        Document size in bytes.
      • getContent

        byte[] getContent()
        Return document content as a byte array
        Returns:
        Byte array
      • extract

        Document extract​(int begin,
                         int end)
                  throws DocumentException
        Return a new document containing pages of a given range. Note : begin and end indicies start at 1
        Parameters:
        begin - Index of the first page to extract
        end - Index of the last page to extract
        Returns:
        A new document.
        Throws:
        DocumentException