PdfObjectCloner

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

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
PdfObjectCloner(registry: ReferenceRegistry)
clonePageDict(srcPageDict: PdfDictionary)PdfDictionaryClones a page dictionary (skipping /Parent and /StructParents).
cloneAnnotationDict(srcAnnot: PdfDictionary)PdfDictionaryClones an annotation dictionary (skipping /P and /Dest, clearing /A/D).
cloneAny(src: PdfBase)PdfBaseClones 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.

See Also