PdfDataObject dataObject = File.resolve(object);
// 1. Evaluating the current object...
if(object instanceof PdfReference)
{
PdfReference reference = (PdfReference)object;
if(visitedReferences.contains(reference))
return 0; // Avoids circular references.
if(dataObject instanceof PdfDictionary
&& PdfName.Page.equals(((PdfDictionary)dataObject).get(PdfName.Type))
&& !isRoot)
return 0; // Avoids references to other pages.
visitedReferences.add(reference);
// Calculate the data size of the current object!
IOutputStream buffer = new Buffer();
reference.getIndirectObject().writeTo(buffer);
dataSize += buffer.getLength();
}
// 2. Evaluating the current object's children...
Collection<PdfDirectObject> values = null;