Package com.lowagie.text.pdf
Class PdfWriter.PdfBody.PdfCrossReference
- java.lang.Object
-
- com.lowagie.text.pdf.PdfWriter.PdfBody.PdfCrossReference
-
- All Implemented Interfaces:
java.lang.Comparable<PdfWriter.PdfBody.PdfCrossReference>
- Enclosing class:
- PdfWriter.PdfBody
public static class PdfWriter.PdfBody.PdfCrossReference extends java.lang.Object implements java.lang.Comparable<PdfWriter.PdfBody.PdfCrossReference>
PdfCrossReference
is an entry in the PDF Cross-Reference table.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
CROSS_REFERENCE_ENTRY_FORMAT
String template for cross-reference entry PDF representation.private int
generation
generation of the object.private long
offset
Byte offset in the PDF file.private int
refnum
private int
type
-
Constructor Summary
Constructors Constructor Description PdfCrossReference(int type, int refnum, long offset, int generation)
PdfCrossReference(int refnum, long offset)
Constructs a cross-reference element for a PdfIndirectObject.PdfCrossReference(int refnum, long offset, int generation)
Constructs a cross-reference element for a PdfIndirectObject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(PdfWriter.PdfBody.PdfCrossReference reference)
Compares currententry
with passedreference
by PDF object number.boolean
equals(java.lang.Object obj)
Checks if two entries are equal if their PDF object numbers are equal.(package private) int
getRefnum()
int
hashCode()
void
toPdf(int midSize, java.io.OutputStream os)
Writes PDF syntax to the OutputStreamvoid
toPdf(java.io.OutputStream os)
Writes PDF representation of cross-reference entry to passed output stream.
-
-
-
Field Detail
-
CROSS_REFERENCE_ENTRY_FORMAT
private static final java.lang.String CROSS_REFERENCE_ENTRY_FORMAT
String template for cross-reference entry PDF representation.- See Also:
Formatter
, Constant Field Values
-
type
private final int type
-
offset
private final long offset
Byte offset in the PDF file.
-
refnum
private final int refnum
-
generation
private final int generation
generation of the object.
-
-
Constructor Detail
-
PdfCrossReference
public PdfCrossReference(int refnum, long offset, int generation)
Constructs a cross-reference element for a PdfIndirectObject.- Parameters:
refnum
- the reference numberoffset
- byte offset of the objectgeneration
- generation number of the object
-
PdfCrossReference
public PdfCrossReference(int refnum, long offset)
Constructs a cross-reference element for a PdfIndirectObject.- Parameters:
refnum
- the reference numberoffset
- byte offset of the object
-
PdfCrossReference
public PdfCrossReference(int type, int refnum, long offset, int generation)
-
-
Method Detail
-
getRefnum
int getRefnum()
-
toPdf
public void toPdf(java.io.OutputStream os) throws java.io.IOException
Writes PDF representation of cross-reference entry to passed output stream.- Parameters:
os
- Output stream this entry to write to- Throws:
java.io.IOException
- If any I/O error occurs
-
toPdf
public void toPdf(int midSize, java.io.OutputStream os) throws java.io.IOException
Writes PDF syntax to the OutputStream- Parameters:
midSize
- the mid sizeos
- the OutputStream- Throws:
java.io.IOException
- on error
-
compareTo
public int compareTo(PdfWriter.PdfBody.PdfCrossReference reference)
Compares currententry
with passedreference
by PDF object number.- Specified by:
compareTo
in interfacejava.lang.Comparable<PdfWriter.PdfBody.PdfCrossReference>
-
equals
public boolean equals(java.lang.Object obj)
Checks if two entries are equal if their PDF object numbers are equal.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- Another cross-reference entry- Returns:
- If null, not of type
PdfWriter.PdfBody.PdfCrossReference
or object numbers are not equal, returns false; true otherwise
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-