Class PdfTarget
A target dictionary locates the target in relation to the source, in much the same way that a relative path describes the physical relationship between two files in a file system.
public class PdfTarget : PdfObjectWrapper<PdfDictionary>
- Inheritance
-
PdfTarget
- Inherited Members
Remarks
A target dictionary locates the target in relation to the source, in much the same way that a relative path describes the physical relationship between two files in a file system. Target dictionaries may be nested recursively to specify one or more intermediate targets before reaching the final one.
Methods
Create(PdfDictionary)
Creates a new PdfTarget object by the underlying dictionary.
public static PdfTarget Create(PdfDictionary pdfObject)
Parameters
pdfObject
PdfDictionarythe underlying dictionary object
Returns
CreateChildTarget()
Creates a new target object pointing to the child of the current document.
public static PdfTarget CreateChildTarget()
Returns
CreateChildTarget(int, int)
Creates a new target object pointing to a file attachment annotation.
public static PdfTarget CreateChildTarget(int pageNumber, int annotationIndex)
Parameters
pageNumber
intthe number of the page in the current document, one-based
annotationIndex
intthe index of the annotation in the Annots entry of the page, zero-based
Returns
- PdfTarget
created object
CreateChildTarget(string)
Creates a new target object pointing to a file in the EmbeddedFiles name tree.
public static PdfTarget CreateChildTarget(string embeddedFileName)
Parameters
embeddedFileName
stringthe name of the file in the EmbeddedFiles name tree
Returns
- PdfTarget
created object
CreateChildTarget(string, string)
Creates a new target object pointing to a file attachment annotation.
public static PdfTarget CreateChildTarget(string namedDestination, string annotationIdentifier)
Parameters
namedDestination
stringa named destination in the current document that provides the page number of the file attachment annotation
annotationIdentifier
stringa unique annotation identifier ( NM entry) of the annotation
Returns
- PdfTarget
created object
CreateParentTarget()
Creates a new target object pointing to the parent of the current document.
public static PdfTarget CreateParentTarget()
Returns
GetAnnotation(PdfDocument)
Gets the annotation specified by /A and /P entry values.
public virtual PdfFileAttachmentAnnotation GetAnnotation(PdfDocument pdfDocument)
Parameters
pdfDocument
PdfDocumentspecifies the corresponding document
Returns
- PdfFileAttachmentAnnotation
the annotation specified by /A and /P entry value.
GetName()
Gets name of the file in the EmbeddedFiles name tree for the child target located in the EmbeddedFiles.
public virtual string GetName()
Returns
- string
the name of the child file for this target
GetTarget()
Get a target dictionary specifying additional path information to the target document.
public virtual PdfTarget GetTarget()
Returns
- PdfTarget
a target dictionary specifying additional path information to the target document
Remarks
Get a target dictionary specifying additional path information to the target document.
If the current target object is the final node in the target path, null
is returned.
IsWrappedObjectMustBeIndirect()
protected override bool IsWrappedObjectMustBeIndirect()
Returns
Put(PdfName, PdfObject)
This is a convenient method to put key-value pairs to the underlying PdfObject.
public virtual PdfTarget Put(PdfName key, PdfObject value)
Parameters
Returns
- PdfTarget
this object wrapper
SetAnnotation(PdfFileAttachmentAnnotation, PdfDocument)
Sets the /P and /A values corresponding to provided annotation, which is already added to a page.
public virtual PdfTarget SetAnnotation(PdfFileAttachmentAnnotation pdfAnnotation, PdfDocument pdfDocument)
Parameters
pdfAnnotation
PdfFileAttachmentAnnotationthe annotation to be set
pdfDocument
PdfDocumentthe corresponding document
Returns
- PdfTarget
this object wrapper
SetName(string)
Sets the name of the file in the EmbeddedFiles name tree for the child target located in the EmbeddedFiles.
public virtual PdfTarget SetName(string name)
Parameters
name
stringthe name of the file
Returns
- PdfTarget
this object wrapper
SetTarget(PdfTarget)
Sets a target dictionary specifying additional path information to the target document.
public virtual PdfTarget SetTarget(PdfTarget target)
Parameters
target
PdfTargetthe additional path target dictionary
Returns
- PdfTarget
this object wrapper
Remarks
Sets a target dictionary specifying additional path information to the target document. If this entry is absent, the current document is the target file containing the destination.