(due to copy propagations to the whole page-tree which this page belongs to).
TODO: 'Annots' entry must be finely treated to include any non-circular reference.
*/
// TODO:IMPL deal with inheritable attributes!!!
File contextFile = context.getFile();
PdfDictionary clone = new PdfDictionary(getBaseDataObject().size());
for(Map.Entry<PdfName,PdfDirectObject> entry : getBaseDataObject().entrySet())
{
PdfName key = entry.getKey();
// Is the entry unwanted?
if(key.equals(PdfName.Parent)
|| key.equals(PdfName.Annots))
continue;
// Insert the clone of the entry into the clone of the page dictionary!
clone.put(
key,
(PdfDirectObject)entry.getValue().clone(contextFile)
);
}
return new Page(contextFile.getIndirectObjects().add(clone).getReference());
}