Package org.apache.pdfbox.util
Class PDFCloneUtility
java.lang.Object
org.apache.pdfbox.util.PDFCloneUtility
Utility class used to clone PDF objects. It keeps track of objects it has already cloned.
- Version:
- $Revision$
-
Constructor Summary
ConstructorsConstructorDescriptionPDFCloneUtility
(PDDocument dest) Creates a new instance for the given target document. -
Method Summary
Modifier and TypeMethodDescriptioncloneForNewDocument
(Object base) Deep-clones the given object for inclusion into a different PDF document identified by the destination parameter.void
cloneMerge
(COSObjectable base, COSObjectable target) Merges two objects of the same type by deep-cloning its members.Returns the destination PDF document this cloner instance is set up for.
-
Constructor Details
-
PDFCloneUtility
Creates a new instance for the given target document.- Parameters:
dest
- the destination PDF document that will receive the clones
-
-
Method Details
-
getDestination
Returns the destination PDF document this cloner instance is set up for.- Returns:
- the destination PDF document
-
cloneForNewDocument
Deep-clones the given object for inclusion into a different PDF document identified by the destination parameter.- Parameters:
base
- the initial object as the root of the deep-clone operation- Returns:
- the cloned instance of the base object
- Throws:
IOException
- if an I/O error occurs
-
cloneMerge
Merges two objects of the same type by deep-cloning its members.
Base and target must be instances of the same class.- Parameters:
base
- the base object to be clonedtarget
- the merge target- Throws:
IOException
- if an I/O error occurs
-