PdfObjectCloner
Overview
PdfObjectCloner is a class in Aspose.PDF FOSS for Java.
Recursively clones a PDF object graph from one document so the result is independent of the source document and can be safely inserted into a target document.
This class provides 5 methods for working with PdfObjectCloner objects in Java programs.
Available methods include: PdfObjectCloner, cloneAnnotationDict, cloneAny, clonePageDict, forgetSource.
All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package.
Properties: ANNOT_STOP_KEYS, GLOBAL_STOP_KEYS, PAGE_STOP_KEYS.
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 |
|---|---|
PdfObjectCloner(registry: ReferenceRegistry) | |
clonePageDict(srcPageDict: PdfDictionary) → PdfDictionary | Clones a page dictionary (skipping /Parent and /StructParents). |
cloneAnnotationDict(srcAnnot: PdfDictionary) → PdfDictionary | Clones an annotation dictionary (skipping /P and /Dest, clearing /A/D). |
cloneAny(src: PdfBase) → PdfBase | Clones an arbitrary PDF object (no extra stop-keys beyond the global set). |
forgetSource(src: PdfBase) | 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. |