Class PdfWriter.PdfBody
java.lang.Object
com.itextpdf.text.pdf.PdfWriter.PdfBody
- Enclosing class:
PdfWriter
This class generates the structure of a PDF document.
This class covers the third section of Chapter 5 in the 'Portable Document Format Reference Manual version 1.3' (page 55-60). It contains the body of a PDF document (section 5.14) and it can also generate a Cross-reference Table (section 5.15).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPdfCrossReferenceis an entry in the PDF Cross-Reference table. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected ByteBufferprotected intprotected longthe current byte position in the body.protected intprotected ByteBufferprotected final PdfWriterprotected final TreeSet<PdfWriter.PdfBody.PdfCrossReference> array containing the cross-reference table of the normal objects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PdfIndirectObjectprotected PdfWriter.PdfBody.PdfCrossReferenceaddToObjStm(PdfObject obj, int nObj) voidprotected intGets a PdfIndirectReference for an object that will be created in the future.longoffset()Returns the offset of the Cross-Reference table.intsize()Returns the total number of objects contained in the CrossReferenceTable of thisBody.protected voidwrite(PdfIndirectObject indirect, int refNumber) protected voidwrite(PdfIndirectObject indirect, int refNumber, int generation) voidwriteCrossReferenceTable(OutputStream os, PdfIndirectReference root, PdfIndirectReference info, PdfIndirectReference encryption, PdfObject fileID, long prevxref) Returns the CrossReferenceTable of theBody.
-
Field Details
-
xrefs
array containing the cross-reference table of the normal objects. -
refnum
protected int refnum -
position
protected long positionthe current byte position in the body. -
writer
-
index
-
streamObjects
-
currentObjNum
protected int currentObjNum -
numObj
protected int numObj
-
-
Constructor Details
-
PdfBody
-
-
Method Details
-
addToObjStm
protected PdfWriter.PdfBody.PdfCrossReference addToObjStm(PdfObject obj, int nObj) throws IOException - Throws:
IOException
-
flushObjStm
- Throws:
IOException
-
getPdfIndirectReference
Gets a PdfIndirectReference for an object that will be created in the future.- Returns:
- a PdfIndirectReference
-
getIndirectReferenceNumber
protected int getIndirectReferenceNumber() -
add
protected PdfIndirectObject add(PdfObject object, int refNumber, int generation, boolean inObjStm) throws IOException - Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
offset
public long offset()Returns the offset of the Cross-Reference table.- Returns:
- an offset
-
size
public int size()Returns the total number of objects contained in the CrossReferenceTable of thisBody.- Returns:
- a number of objects
-
writeCrossReferenceTable
public void writeCrossReferenceTable(OutputStream os, PdfIndirectReference root, PdfIndirectReference info, PdfIndirectReference encryption, PdfObject fileID, long prevxref) throws IOException Returns the CrossReferenceTable of theBody.- Parameters:
os-root-info-encryption-fileID-prevxref-- Throws:
IOException
-