Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.interactive.action

public Class PDTargetDirectory

extends Object
implements COSObjectable
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.pdmodel.common.COSObjectable
Imports
org.apache.pdfbox.cos.COSBase, .COSDictionary, .COSName, .COSString, org.apache.pdfbox.pdmodel.common.COSObjectable, org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDNamedDestination

A target dictionary specifying path information to the target document. Each target dictionary specifies one element in the full path to the target and may have nested target dictionaries specifying additional elements.
Author
Tilman Hausherr

Field Summary

Modifier and TypeField and Description
private final COSDictionary

Constructor Summary

AccessConstructor and Description
public
PDTargetDirectory()

Default constructor, creates target directory.

public
PDTargetDirectory(COSDictionary
The existing graphics state.
dictionary
)

Create a target directory from an existing dictionary.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the zero based page number or -1 if the /P entry value is missing or not a number.
getAnnotationIndex
()

If the value in the /A entry is an integer, this will get the index (zero-based) of the annotation in the /Annots array of the page specified by the /P entry.

public String

Returns:

the /NM value of an annotation dictionary or null if the /A entry value is missing or not a string.
getAnnotationName
()

If the value in the /A entry is a string, this will get the value of the /NM entry in the annotation dictionary.

public COSDictionary

Returns:

The underlying dictionary for this class.
getCOSObject
()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

This will get the underlying dictionary that this class acts on.

public String

Returns:

a filename or null if there is none.
getFilename
()

Get the name of the file as found in the EmbeddedFiles name tree.

public PDNamedDestination

Returns:

a named destination or null if the /P entry value is missing or not a string.
getNamedDestination
()

If the value in the /P entry is a string, this will get a named destination in the current document that provides the page number of the file attachment annotation.

public int

Returns:

the zero based page number or -1 if the /P entry value is missing or not a number.
getPageNumber
()

If the value in the /P entry is an integer, this will get the page number (zero-based) in the current document containing the file attachment annotation.

public COSName

Returns:

the relationship as a name. Valid values are P (the target is the parent of the current document) and C (the target is a child of the current document). Invalid values or null are also returned.
getRelationship
()

Get the relationship between the current document and the target (which may be an intermediate target).

public PDTargetDirectory

Returns:

the target directory or null if the current document is the target file containing the destination.
getTargetDirectory
()

Get the target directory.

public void
setAnnotationIndex(int
the zero based index. If this is < 0 then the entry is removed.
index
)

This will set the index (zero-based) of the annotation in the /Annots array of the page specified by the /P entry.

public void
setAnnotationName(String
the /NM value of an annotation dictionary or null if the entry is to be removed.
name
)

This will get the value of the /NM entry in the annotation dictionary.

public void
setFilename(String
a filename or null if the entry is to be deleted.
filename
)

Sets the name of the file as found in the EmbeddedFiles name tree.

public void
setNamedDestination(PDNamedDestination
a named destination or null if the entry is to be removed.
dest
)

This will set a named destination in the current document that provides the page number of the file attachment annotation.

public void
setPageNumber(int
the zero based page number. If this is < 0 then the entry is removed.
pageNumber
)

Set the page number (zero-based) in the current document containing the file attachment annotation.

public void
setRelationship(COSName
Valid values are P (the target is the parent of the current document) and C (the target is a child of the current document). throws IllegalArgumentException if the parameter is not P or C.
relationship
)

Set the relationship between the current document and the target (which may be an intermediate target).

public void
setTargetDirectory(PDTargetDirectory
the target directory or null if the current document is the target file containing the destination.
targetDirectory
)

Sets the target directory.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dictback to summary
private final COSDictionary dict

Constructor Detail

PDTargetDirectoryback to summary
public PDTargetDirectory()

Default constructor, creates target directory.

PDTargetDirectoryback to summary
public PDTargetDirectory(COSDictionary dictionary)

Create a target directory from an existing dictionary.

Parameters
dictionary:COSDictionary

The existing graphics state.

Method Detail

getAnnotationIndexback to summary
public int getAnnotationIndex()

If the value in the /A entry is an integer, this will get the index (zero-based) of the annotation in the /Annots array of the page specified by the /P entry.

Returns:int

the zero based page number or -1 if the /P entry value is missing or not a number.

getAnnotationNameback to summary
public String getAnnotationName()

If the value in the /A entry is a string, this will get the value of the /NM entry in the annotation dictionary.

Returns:String

the /NM value of an annotation dictionary or null if the /A entry value is missing or not a string.

getCOSObjectback to summary
public COSDictionary getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

This will get the underlying dictionary that this class acts on.

Returns:COSDictionary

The underlying dictionary for this class.

Annotations
@Override
getFilenameback to summary
public String getFilename()

Get the name of the file as found in the EmbeddedFiles name tree. This is only to be used if the target is a child of the current document.

Returns:String

a filename or null if there is none.

getNamedDestinationback to summary
public PDNamedDestination getNamedDestination()

If the value in the /P entry is a string, this will get a named destination in the current document that provides the page number of the file attachment annotation.

Returns:PDNamedDestination

a named destination or null if the /P entry value is missing or not a string.

getPageNumberback to summary
public int getPageNumber()

If the value in the /P entry is an integer, this will get the page number (zero-based) in the current document containing the file attachment annotation.

Returns:int

the zero based page number or -1 if the /P entry value is missing or not a number.

getRelationshipback to summary
public COSName getRelationship()

Get the relationship between the current document and the target (which may be an intermediate target).

Returns:COSName

the relationship as a name. Valid values are P (the target is the parent of the current document) and C (the target is a child of the current document). Invalid values or null are also returned.

getTargetDirectoryback to summary
public PDTargetDirectory getTargetDirectory()

Get the target directory. If this entry is absent, the current document is the target file containing the destination.

Returns:PDTargetDirectory

the target directory or null if the current document is the target file containing the destination.

setAnnotationIndexback to summary
public void setAnnotationIndex(int index)

This will set the index (zero-based) of the annotation in the /Annots array of the page specified by the /P entry.

Parameters
index:int

the zero based index. If this is < 0 then the entry is removed.

setAnnotationNameback to summary
public void setAnnotationName(String name)

This will get the value of the /NM entry in the annotation dictionary.

Parameters
name:String

the /NM value of an annotation dictionary or null if the entry is to be removed.

setFilenameback to summary
public void setFilename(String filename)

Sets the name of the file as found in the EmbeddedFiles name tree. This is only to be used if the target is a child of the current document.

Parameters
filename:String

a filename or null if the entry is to be deleted.

setNamedDestinationback to summary
public void setNamedDestination(PDNamedDestination dest)

This will set a named destination in the current document that provides the page number of the file attachment annotation.

Parameters
dest:PDNamedDestination

a named destination or null if the entry is to be removed.

setPageNumberback to summary
public void setPageNumber(int pageNumber)

Set the page number (zero-based) in the current document containing the file attachment annotation.

Parameters
pageNumber:int

the zero based page number. If this is < 0 then the entry is removed.

setRelationshipback to summary
public void setRelationship(COSName relationship)

Set the relationship between the current document and the target (which may be an intermediate target).

Parameters
relationship:COSName

Valid values are P (the target is the parent of the current document) and C (the target is a child of the current document). throws IllegalArgumentException if the parameter is not P or C.

setTargetDirectoryback to summary
public void setTargetDirectory(PDTargetDirectory targetDirectory)

Sets the target directory.

Parameters
targetDirectory:PDTargetDirectory

the target directory or null if the current document is the target file containing the destination.