org.apache.pdfbox.multipdf

## Class PDFCloneUtility

- java.lang.Object
- - org.apache.pdfbox.multipdf.PDFCloneUtility

    public class PDFCloneUtility
    extends Object

Utility class used to clone PDF objects. It keeps track of objects it has already cloned.

### Constructor Summary

Constructors
`protected` `PDFCloneUtility(PDDocument dest)` Creates a new instance for the given target document.

### Method Summary

All Methods Instance Methods Concrete Methods
`<TCOSBase extends COSBase> TCOSBase` `cloneForNewDocument(TCOSBase base)` Deep-clones the given object for inclusion into a different PDF document identified by the destination parameter.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PDFCloneUtility

    protected PDFCloneUtility(PDDocument dest)

Creates a new instance for the given target document.

Parameters:
  `dest` - the destination PDF document that will receive the clones

### Method Detail

#### cloneForNewDocument

    public <TCOSBase extends COSBase> TCOSBase cloneForNewDocument(TCOSBase base)
                                                            throws IOException

Deep-clones the given object for inclusion into a different PDF document identified by the destination parameter. Expert use only, don’t use it if you don’t know exactly what you are doing.

Type Parameters:
  `TCOSBase` - The type to be returned.
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