COSCloner

Overview

COSCloner is a class in Aspose.Pdf FOSS for Java.

Recursively clones a COS graph from one document so the result is independent of the source document and can be safely inserted into a target document.

Properties

NameTypeAccessDescription
PAGE_STOP_KEYSSet<String>ReadKeys skipped when cloning a page dictionary.
ANNOT_STOP_KEYSSet<String>ReadKeys skipped when cloning an annotation dictionary.
GLOBAL_STOP_KEYSSet<String>ReadKeys skipped in any dictionary.

Methods

SignatureDescription
COSCloner(registry: ReferenceRegistry)
clonePageDict(srcPageDict: COSDictionary)COSDictionaryClones a page dictionary (skipping /Parent and /StructParents).
cloneAnnotationDict(srcAnnot: COSDictionary)COSDictionaryClones an annotation dictionary (skipping /P and /Dest, clearing /A/D).
cloneAny(src: COSBase)COSBaseClones an arbitrary COS object (no extra stop-keys beyond the global set).
forgetSource(src: COSBase)Evicts {@code src} from the visited cache so the next {@code clone*}
call on it produces a fresh clone instead of returning the previously
cached one.

See Also