Table of Contents

Class PdfTarget

Namespace
iText.Kernel.Pdf.Action
Assembly
itext.kernel.dll

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 PdfDictionary

the underlying dictionary object

Returns

PdfTarget

a new PdfTarget object by the underlying dictionary

CreateChildTarget()

Creates a new target object pointing to the child of the current document.

public static PdfTarget CreateChildTarget()

Returns

PdfTarget

created PdfTarget

CreateChildTarget(int, int)

Creates a new target object pointing to a file attachment annotation.

public static PdfTarget CreateChildTarget(int pageNumber, int annotationIndex)

Parameters

pageNumber int

the number of the page in the current document, one-based

annotationIndex int

the 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 string

the 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 string

a named destination in the current document that provides the page number of the file attachment annotation

annotationIdentifier string

a 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

PdfTarget

created PdfTarget

GetAnnotation(PdfDocument)

Gets the annotation specified by /A and /P entry values.

public virtual PdfFileAttachmentAnnotation GetAnnotation(PdfDocument pdfDocument)

Parameters

pdfDocument PdfDocument

specifies 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

bool

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

key PdfName

the key, a PdfName instance

value PdfObject

the value

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 PdfFileAttachmentAnnotation

the annotation to be set

pdfDocument PdfDocument

the 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 string

the 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 PdfTarget

the 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.