Package org.ghost4j.document
Class PSDocument
- java.lang.Object
-
- org.ghost4j.document.AbstractDocument
-
- org.ghost4j.document.PSDocument
-
- All Implemented Interfaces:
java.io.Serializable
,Document
public class PSDocument extends AbstractDocument
Class representing a PostScript document.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
Serial version UID.-
Fields inherited from class org.ghost4j.document.AbstractDocument
content, READ_BUFFER_SIZE
-
Fields inherited from interface org.ghost4j.document.Document
TYPE_PDF, TYPE_POSTSCRIPT
-
-
Constructor Summary
Constructors Constructor Description PSDocument()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(Document document)
This methods appends pages the DSC way (only by relying on the structure).Document
extract(int begin, int end)
Return a new document containing pages of a given range.int
getPageCount()
Return document page countjava.lang.String
getType()
Return the type of the document.void
load(java.io.InputStream inputStream)
Load document from an InputStream.-
Methods inherited from class org.ghost4j.document.AbstractDocument
assertValidPageIndex, assertValidPageRange, explode, getContent, getSize, load, write, write
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serial version UID.- See Also:
- Constant Field Values
-
-
Method Detail
-
load
public void load(java.io.InputStream inputStream) throws java.io.IOException
Description copied from interface:Document
Load document from an InputStream.- Specified by:
load
in interfaceDocument
- Overrides:
load
in classAbstractDocument
- Throws:
java.io.IOException
-
getPageCount
public int getPageCount() throws DocumentException
Description copied from interface:Document
Return document page count- Returns:
- Number of pages.
- Throws:
DocumentException
-
extract
public Document extract(int begin, int end) throws DocumentException
Description copied from interface:Document
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 extractend
- Index of the last page to extract- Returns:
- A new document.
- Throws:
DocumentException
-
append
public void append(Document document) throws DocumentException
This methods appends pages the DSC way (only by relying on the structure). It does not work with documents generated by different softwares / spools. It is intended to be used only for rearranging pages of the same document. If you need to append a different document, consider using the SafeAppenderModifier instead.- Specified by:
append
in interfaceDocument
- Overrides:
append
in classAbstractDocument
- Parameters:
document
- Document ot append- Throws:
DocumentException
- See Also:
SafeAppenderModifier
-
getType
public java.lang.String getType()
Description copied from interface:Document
Return the type of the document.- Returns:
- A String representing the document type name.
-
-