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

public Class PDAnnotationFileAttachment

extends PDAnnotationMarkup
Class Inheritance
Imports
java.io.IOException, org.apache.pdfbox.cos.COSDictionary, .COSName, org.apache.pdfbox.pdmodel.PDDocument, org.apache.pdfbox.pdmodel.common.filespecification.PDFileSpecification, org.apache.pdfbox.pdmodel.interactive.annotation.handlers.PDAppearanceHandler, .PDFileAttachmentAppearanceHandler

This is the class that represents a file attachment.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
public static final String
ATTACHMENT_NAME_GRAPH

See get/setAttachmentName.

public static final String
ATTACHMENT_NAME_PAPERCLIP

See get/setAttachmentName.

public static final String
ATTACHMENT_NAME_PUSH_PIN

See get/setAttachmentName.

public static final String
ATTACHMENT_NAME_TAG

See get/setAttachmentName.

private PDAppearanceHandler
public static final String
SUB_TYPE

The type of annotation.

Inherited from org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup:
RT_GROUPRT_REPLY

Constructor Summary

AccessConstructor and Description
public
public
PDAnnotationFileAttachment(COSDictionary
the PDF object to represent as a field.
field
)

Creates a Link annotation from a COSDictionary, expected to be a correct object definition.

Method Summary

Modifier and TypeMethod and Description
public void
public void
constructAppearances(PDDocument
the related document
document
)

Overrides org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.constructAppearances.

Create the appearance entry for this annotation.

public String

Returns:

The name that describes the visual cue for the attachment.
getAttachmentName
()

This is the name used to draw the type of attachment.

public PDFileSpecification

Returns:

The attached file.
getFile
()

Return the attached file.

public void
setAttachmentName(String
The name of the visual icon to draw.
name
)

Set the name used to draw the attachment icon.

public void
setCustomAppearanceHandler(PDAppearanceHandler
custom appearance handler
appearanceHandler
)

Set a custom appearance handler for generating the annotations appearance streams.

public void
setFile(PDFileSpecification
The file that is attached.
file
)

Set the attached file.

Inherited from org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup:
getBorderStylegetConstantOpacitygetCreationDategetExternalDatagetInReplyTogetIntentgetPopupgetReplyTypegetRichContentsgetSubjectgetTitlePopupsetBorderStylesetConstantOpacitysetCreationDatesetExternalDatasetInReplyTosetIntentsetPopupsetReplyTypesetRichContentssetSubjectsetTitlePopup

Field Detail

ATTACHMENT_NAME_GRAPHback to summary
public static final String ATTACHMENT_NAME_GRAPH

See get/setAttachmentName.

ATTACHMENT_NAME_PAPERCLIPback to summary
public static final String ATTACHMENT_NAME_PAPERCLIP

See get/setAttachmentName.

ATTACHMENT_NAME_PUSH_PINback to summary
public static final String ATTACHMENT_NAME_PUSH_PIN

See get/setAttachmentName.

ATTACHMENT_NAME_TAGback to summary
public static final String ATTACHMENT_NAME_TAG

See get/setAttachmentName.

customAppearanceHandlerback to summary
private PDAppearanceHandler customAppearanceHandler
SUB_TYPEback to summary
public static final String SUB_TYPE

The type of annotation.

Constructor Detail

PDAnnotationFileAttachmentback to summary
public PDAnnotationFileAttachment()

Constructor.

PDAnnotationFileAttachmentback to summary
public PDAnnotationFileAttachment(COSDictionary field)

Creates a Link annotation from a COSDictionary, expected to be a correct object definition.

Parameters
field:COSDictionary

the PDF object to represent as a field.

Method Detail

constructAppearancesback to summary
public void constructAppearances()

Overrides org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.constructAppearances.

Doc from org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.constructAppearances.

Create the appearance entry for this annotation. Not having it may prevent display in some viewers. This method is for overriding in subclasses, the default implementation does nothing.

Annotations
@Override
constructAppearancesback to summary
public void constructAppearances(PDDocument document)

Overrides org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.constructAppearances.

Doc from org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.constructAppearances.

Create the appearance entry for this annotation. Not having it may prevent display in some viewers. This method is for overriding in subclasses, the default implementation does nothing.

Parameters
document:PDDocument

the related document

Annotations
@Override
getAttachmentNameback to summary
public String getAttachmentName()

This is the name used to draw the type of attachment. See the ATTACHMENT_NAME_XXX constants.

Returns:String

The name that describes the visual cue for the attachment.

getFileback to summary
public PDFileSpecification getFile() throws IOException

Return the attached file.

Returns:PDFileSpecification

The attached file.

Exceptions
IOException:
If there is an error creating the file spec.
setAttachmentNameback to summary
public void setAttachmentName(String name)

Set the name used to draw the attachment icon. See the ATTACHMENT_NAME_XXX constants.

Parameters
name:String

The name of the visual icon to draw.

setCustomAppearanceHandlerback to summary
public void setCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)

Set a custom appearance handler for generating the annotations appearance streams.

Parameters
appearanceHandler:PDAppearanceHandler

custom appearance handler

setFileback to summary
public void setFile(PDFileSpecification file)

Set the attached file.

Parameters
file:PDFileSpecification

The file that is attached.