Collections.sort(getXRefEntries());
COSWriterXRefEntry lastEntry = getXRefEntries().get( getXRefEntries().size()-1);
trailer.setInt(COSName.SIZE, (int)lastEntry.getKey().getNumber()+1);
// Only need to stay, if an incremental update will be performed
if (!incrementalUpdate)
trailer.removeItem( COSName.PREV );
// Remove a checksum if present
trailer.removeItem( COSName.getPDFName("DocChecksum") );
/**
COSObject catalog = doc.getCatalog();