|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pdfbox.pdfparser.XrefTrailerResolver
public class XrefTrailerResolver
This class will collect all XRef/trailer objects and creates correct
xref/trailer information after all objects are read using startxref
and 'Prev' information (unused XRef/trailer objects are discarded).
In case of missing startxref or wrong startxref pointer all
XRef/trailer objects are used to create xref table / trailer dictionary
in order they occur.
For each new xref object/XRef stream method nextXrefObj(int)
must be called with start byte position. All following calls to
setXRef(COSObjectKey, int)
or setTrailer(COSDictionary)
will add the data for this byte position.
After all objects are parsed the startxref position must be provided
using setStartxref(int)
. This is used to build the chain of
active xref/trailer objects used for creating document trailer and xref table.
Constructor Summary | |
---|---|
XrefTrailerResolver()
|
Method Summary | |
---|---|
COSDictionary |
getTrailer()
Gets the resolved trailer. |
Map<COSObjectKey,Integer> |
getXrefTable()
Gets the resolved xref table. |
void |
nextXrefObj(int startBytePos)
Signals that a new XRef object (table or stream) starts. |
void |
setStartxref(int startxrefBytePos)
Sets the byte position of the first XRef (has to be called after very last startxref was read). |
void |
setTrailer(COSDictionary trailer)
Adds trailer information for current XRef object. |
void |
setXRef(COSObjectKey objKey,
int offset)
Populate XRef HashMap of current XRef object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XrefTrailerResolver()
Method Detail |
---|
public void nextXrefObj(int startBytePos)
startBytePos
- the offset to start atpublic void setXRef(COSObjectKey objKey, int offset)
objKey
- The objkey, with id and gen numbersoffset
- The byte offset in this filepublic void setTrailer(COSDictionary trailer)
trailer
- the current document trailer dictionarypublic void setStartxref(int startxrefBytePos)
public COSDictionary getTrailer()
null
in case
setStartxref(int)
was not called before.
public Map<COSObjectKey,Integer> getXrefTable()
null
in case
setStartxref(int)
was not called before.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |