// first set an entry for the null entry in the xref table
// this is probably not necessary
// addXRefEntry(COSWriterXRefEntry.getNullEntry());
// create a new XRefStrema object
PDFXRefStream pdfxRefStream = new PDFXRefStream();
// add all entries from the incremental update.
List<COSWriterXRefEntry> xRefEntries2 = getXRefEntries();
for ( COSWriterXRefEntry cosWriterXRefEntry : xRefEntries2 )
{
pdfxRefStream.addEntry(cosWriterXRefEntry);
}
COSDictionary trailer = doc.getTrailer();
// trailer.setLong(COSName.PREV, hybridPrev == -1 ? prev : hybridPrev);
trailer.setLong(COSName.PREV, doc.getStartXref());
pdfxRefStream.addTrailerInfo(trailer);
// the size is the highest object number+1. we add one more
// for the xref stream object we are going to write
pdfxRefStream.setSize(getNumber() + 2);
setStartxref(getStandardOutput().getPos());
COSStream stream2 = pdfxRefStream.getStream();
doWriteObject(stream2);
}
if (!doc.isXRefStream() || hybridPrev != -1)
{