Package com.itextpdf.kernel.pdf
Class DestinationResolverCopyFilter
- java.lang.Object
-
- com.itextpdf.kernel.pdf.DestinationResolverCopyFilter
-
- All Implemented Interfaces:
ICopyFilter
public class DestinationResolverCopyFilter extends java.lang.Object implements ICopyFilter
A copy filter that will handle goto annotations and actions separately.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.List<PdfName>
EXCLUDE_KEYS_ACTIONCOPY
private PdfDocument
fromDocument
private PdfDocument
targetDocument
-
Constructor Summary
Constructors Constructor Description DestinationResolverCopyFilter(PdfDocument fromDocument, PdfDocument targetDocument)
Initilazes a copy filter that will set all needed information aside to handle objects with a page destination after all pages are copied.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static PdfObject
getDirectPdfObject(PdfObject value)
private void
processAction(PdfObject newParent, PdfName name, PdfDictionary dict)
private boolean
processLinkAnnotion(PdfObject newParent, PdfObject value, PdfDictionary dict)
boolean
shouldProcess(PdfObject newParent, PdfName name, PdfObject value)
Verifies whether a PdfObject should be copied in the copying flow.
-
-
-
Field Detail
-
EXCLUDE_KEYS_ACTIONCOPY
private static final java.util.List<PdfName> EXCLUDE_KEYS_ACTIONCOPY
-
targetDocument
private final PdfDocument targetDocument
-
fromDocument
private final PdfDocument fromDocument
-
-
Constructor Detail
-
DestinationResolverCopyFilter
public DestinationResolverCopyFilter(PdfDocument fromDocument, PdfDocument targetDocument)
Initilazes a copy filter that will set all needed information aside to handle objects with a page destination after all pages are copied.- Parameters:
fromDocument
- thePdfDocument
the pages are copied fromtargetDocument
- thePdfDocument
the pages are copied to
-
-
Method Detail
-
shouldProcess
public boolean shouldProcess(PdfObject newParent, PdfName name, PdfObject value)
Description copied from interface:ICopyFilter
Verifies whether a PdfObject should be copied in the copying flow. The filter class has to take care of alternative ways to process the PdfObject if needed. When more than one filter should be used, it is upon the user to chain them together.- Specified by:
shouldProcess
in interfaceICopyFilter
- Parameters:
newParent
- the parent in the target of the PdfObject to be checkedname
- the name of the PdfObject if the parent is a PdfDictionaryvalue
- the PdfObject toi be checked- Returns:
- true, the PdfObject will be copied, false it will not be copied
-
processLinkAnnotion
private boolean processLinkAnnotion(PdfObject newParent, PdfObject value, PdfDictionary dict)
-
processAction
private void processAction(PdfObject newParent, PdfName name, PdfDictionary dict)
-
-