public class PDFCloneUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Set<COSBase> |
clonedValues |
private java.util.Map<java.lang.Object,COSBase> |
clonedVersion |
private PDDocument |
destination |
Constructor and Description |
---|
PDFCloneUtility(PDDocument dest)
Creates a new instance for the given target document.
|
Modifier and Type | Method and Description |
---|---|
COSBase |
cloneForNewDocument(java.lang.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.
|
PDDocument |
getDestination()
Returns the destination PDF document this cloner instance is set up for.
|
private final PDDocument destination
private final java.util.Map<java.lang.Object,COSBase> clonedVersion
private final java.util.Set<COSBase> clonedValues
public PDFCloneUtility(PDDocument dest)
dest
- the destination PDF document that will receive the clonespublic PDDocument getDestination()
public COSBase cloneForNewDocument(java.lang.Object base) throws java.io.IOException
base
- the initial object as the root of the deep-clone operationjava.io.IOException
- if an I/O error occurspublic void cloneMerge(COSObjectable base, COSObjectable target) throws java.io.IOException
base
- the base object to be clonedtarget
- the merge targetjava.io.IOException
- if an I/O error occurs