nextXrefObj(long, XRefType)
must be called with start byte position. All following calls to
setXRef(COSObjectKey, long) or setTrailer(COSDictionary)
will add the data for this byte position.
After all objects are parsed the startxref position must be provided
using setStartxref(long). This is used to build the chain of
active xref/trailer objects used for creating document trailer and xref table.
| Modifier and Type | Class and Description |
|---|---|
| private static class | XrefTrailerResolver.
A class which represents a xref/trailer object. |
| public static enum | XrefTrailerResolver.
The XRefType of a trailer. |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private XrefTrailerResolver. | |
| private static final Log | LOG
Log instance. |
| private XrefTrailerResolver. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Set | Returns: set of object numbers referenced for given object stream ornull if setStartxref(long) was not
called before so that no resolved xref table existsobject number of object stream for which contained object numbers
should be returned objstmObjNr)Returns object numbers which are referenced as contained in object stream with specified object number. |
| public COSDictionary | Returns: the current trailer.Returns the trailer last set by |
| public final COSDictionary | Returns: the first trailer or nullReturns the first trailer if at least one exists. |
| public final COSDictionary | |
| public COSDictionary | |
| public final int | |
| public Map | |
| public XrefTrailerResolver. | |
| public void | nextXrefObj(final long
the offset to start at startBytePos, XrefTrailerResolver.the type of the Xref object typeSignals that a new XRef object (table or stream) starts. |
| protected void | |
| public void | setStartxref(long
starting position of the first XRef startxrefBytePosValue)Sets the byte position of the first XRef (has to be called after very last startxref was read). |
| public void | setTrailer(COSDictionary
the current document trailer dictionary trailer)Adds trailer information for current XRef object. |
| public void | setXRef(COSObjectKey
The objkey, with id and gen numbers objKey, long The byte offset in this file offset)Populate XRef HashMap of current XRef object. |
| bytePosToXrefMap | back to summary |
|---|---|
| private final Map<Long, XrefTrailerResolver. | |
| curXrefTrailerObj | back to summary |
|---|---|
| private XrefTrailerResolver. | |
| LOG | back to summary |
|---|---|
| private static final Log LOG Log instance. | |
| resolvedXrefTrailer | back to summary |
|---|---|
| private XrefTrailerResolver. | |
| XrefTrailerResolver | back to summary |
|---|---|
| public XrefTrailerResolver() | |
| getContainedObjectNumbers | back to summary |
|---|---|
| public Set Returns object numbers which are referenced as contained in object stream with specified object number. This will scan resolved xref table for all entries having negated stream object number as value.
| |
| getCurrentTrailer | back to summary |
|---|---|
| public COSDictionary getCurrentTrailer() Returns the trailer last set by
| |
| getFirstTrailer | back to summary |
|---|---|
| public final COSDictionary getFirstTrailer() Returns the first trailer if at least one exists.
| |
| getLastTrailer | back to summary |
|---|---|
| public final COSDictionary getLastTrailer() Returns the last trailer if at least one exists.
| |
| getTrailer | back to summary |
|---|---|
| public COSDictionary getTrailer() Gets the resolved trailer. Might return
| |
| getTrailerCount | back to summary |
|---|---|
| public final int getTrailerCount() Returns the count of trailers.
| |
| getXrefTable | back to summary |
|---|---|
| public Map Gets the resolved xref table. Might return
| |
| getXrefType | back to summary |
|---|---|
| public XrefTrailerResolver. Returns the XRefTxpe of the resolved trailer.
| |
| nextXrefObj | back to summary |
|---|---|
| public void nextXrefObj(final long startBytePos, XrefTrailerResolver. Signals that a new XRef object (table or stream) starts.
| |
| reset | back to summary |
|---|---|
| protected void reset() Reset all data so that it can be used to rebuild the trailer. | |
| setStartxref | back to summary |
|---|---|
| public void setStartxref(long startxrefBytePosValue) Sets the byte position of the first XRef (has to be called after very last startxref was read). This is used to resolve chain of active XRef/trailer. In case startxref position is not found we output a warning and use all XRef/trailer objects combined in byte position order. Thus for incomplete PDF documents with missing startxref one could call this method with parameter value -1.
| |
| setTrailer | back to summary |
|---|---|
| public void setTrailer(COSDictionary trailer) Adds trailer information for current XRef object.
| |
| setXRef | back to summary |
|---|---|
| public void setXRef(COSObjectKey objKey, long offset) Populate XRef HashMap of current XRef object. Will add an Xreftable entry that maps ObjectKeys to byte offsets in the file.
| |
| Modifier and Type | Field and Description |
|---|---|
| protected COSDictionary | |
| private final Map | |
| private XrefTrailerResolver. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| trailer | back to summary |
|---|---|
| protected COSDictionary trailer | |
| xrefTable | back to summary |
|---|---|
| private final Map<COSObjectKey, Long> xrefTable | |
| xrefType | back to summary |
|---|---|
| private XrefTrailerResolver. | |
| XrefTrailerObj | back to summary |
|---|---|
| private XrefTrailerObj() Default constructor. | |
| reset | back to summary |
|---|---|
| public void reset() | |
| Modifier and Type | Field and Description |
|---|---|
| public static final XrefTrailerResolver. | STREAM
XRef stream type. |
| public static final XrefTrailerResolver. | TABLE
XRef table type. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static XrefTrailerResolver. | |
| public static XrefTrailerResolver. |
| STREAM | back to summary |
|---|---|
| public static final XrefTrailerResolver. XRef stream type. | |
| TABLE | back to summary |
|---|---|
| public static final XrefTrailerResolver. XRef table type. | |
| XRefType | back to summary |
|---|---|
| private XRefType() | |
| valueOf | back to summary |
|---|---|
| public static XrefTrailerResolver. | |
| values | back to summary |
|---|---|
| public static XrefTrailerResolver. | |