public static class PdfWriter.PdfBody extends Object
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).
PdfWriter
, PdfObject
, PdfIndirectObject
Modifier and Type | Class and Description |
---|---|
static class |
PdfWriter.PdfBody.PdfCrossReference
PdfCrossReference is an entry in the PDF Cross-Reference table.
|
Modifier and Type | Field and Description |
---|---|
protected int |
currentObjNum |
protected ByteBuffer |
index |
protected int |
numObj |
protected long |
position
the current byte position in the body.
|
protected int |
refnum |
protected ByteBuffer |
streamObjects |
protected PdfWriter |
writer |
protected TreeSet<PdfWriter.PdfBody.PdfCrossReference> |
xrefs
array containing the cross-reference table of the normal objects.
|
Modifier | Constructor and Description |
---|---|
protected |
PdfBody(PdfWriter writer)
Constructs a new PdfBody .
|
Modifier and Type | Method and Description |
---|---|
protected PdfIndirectObject |
add(PdfObject object, int refNumber, int generation, boolean inObjStm) |
protected PdfWriter.PdfBody.PdfCrossReference |
addToObjStm(PdfObject obj, int nObj) |
void |
flushObjStm() |
protected int |
getIndirectReferenceNumber() |
PdfIndirectReference |
getPdfIndirectReference()
Gets a PdfIndirectReference for an object that will be created in the future.
|
long |
offset()
Returns the offset of the Cross-Reference table.
|
int |
size()
Returns the total number of objects contained in the CrossReferenceTable of this Body .
|
protected void |
write(PdfIndirectObject indirect, int refNumber) |
protected void |
write(PdfIndirectObject indirect, int refNumber, int generation) |
void |
writeCrossReferenceTable(OutputStream os, PdfIndirectReference root, PdfIndirectReference info, PdfIndirectReference encryption, PdfObject fileID, long prevxref)
Returns the CrossReferenceTable of the Body .
|
protected final TreeSet<PdfWriter.PdfBody.PdfCrossReference> xrefs
protected int refnum
protected long position
protected final PdfWriter writer
protected ByteBuffer index
protected ByteBuffer streamObjects
protected int currentObjNum
protected int numObj
protected PdfBody(PdfWriter writer)
PdfBody
.
writer
-
protected PdfWriter.PdfBody.PdfCrossReference addToObjStm(PdfObject obj, int nObj) throws IOException
IOException
public void flushObjStm() throws IOException
IOException
public PdfIndirectReference getPdfIndirectReference()
protected int getIndirectReferenceNumber()
protected PdfIndirectObject add(PdfObject object, int refNumber, int generation, boolean inObjStm) throws IOException
IOException
protected void write(PdfIndirectObject indirect, int refNumber) throws IOException
IOException
protected void write(PdfIndirectObject indirect, int refNumber, int generation) throws IOException
IOException
public long offset()
public int size()
Body
.
public void writeCrossReferenceTable(OutputStream os, PdfIndirectReference root, PdfIndirectReference info, PdfIndirectReference encryption, PdfObject fileID, long prevxref) throws IOException
Body
.
os
-
root
-
info
-
encryption
-
fileID
-
prevxref
-
IOException
Copyright © 1998–2017. All rights reserved.