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
| Name | Type | Access | Description |
|---|---|---|---|
PAGE_STOP_KEYS | Set<String> | Read | Keys skipped when cloning a page dictionary. |
ANNOT_STOP_KEYS | Set<String> | Read | Keys skipped when cloning an annotation dictionary. |
GLOBAL_STOP_KEYS | Set<String> | Read | Keys skipped in any dictionary. |
Methods
| Signature | Description |
|---|---|
COSCloner(registry: ReferenceRegistry) | |
clonePageDict(srcPageDict: COSDictionary) → COSDictionary | Clones a page dictionary (skipping /Parent and /StructParents). |
cloneAnnotationDict(srcAnnot: COSDictionary) → COSDictionary | Clones an annotation dictionary (skipping /P and /Dest, clearing /A/D). |
cloneAny(src: COSBase) → COSBase | Clones 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. |