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

public Class PDAnnotationCaret

extends PDAnnotationMarkup
Class Inheritance
Imports
org.apache.pdfbox.cos.COSArray, .COSDictionary, .COSFloat, .COSName, org.apache.pdfbox.pdmodel.PDDocument, org.apache.pdfbox.pdmodel.interactive.annotation.handlers.PDAppearanceHandler, .PDCaretAppearanceHandler

Author
Paul King

Field Summary

Modifier and TypeField and Description
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
PDAnnotationCaret(COSDictionary
the PDF object to represent as a field.
field
)

Creates a Caret 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 float[]

Returns:

the differences. If the entry hasn't been set am empty array is returned.
getRectDifferences
()

This will get the margin between the annotations "outer" rectangle defined by /Rect and the boundaries of the underlying caret.

public void
setCustomAppearanceHandler(PDAppearanceHandler
custom appearance handler
appearanceHandler
)

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

public void
setRectDifferences(float
from the annotations /Rect entry
difference
)

This will set the difference between the annotations "outer" rectangle defined by /Rect and boundaries of the underlying.

public void
setRectDifferences(float
left difference from the annotations /Rect entry
differenceLeft
,
float
top difference from the annotations /Rect entry
differenceTop
,
float
right difference from the annotations /Rect entry
differenceRight
,
float
bottom difference from the annotations /Rect entry
differenceBottom
)

This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.

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

Field Detail

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

The type of annotation.

Constructor Detail

PDAnnotationCaretback to summary
public PDAnnotationCaret()
PDAnnotationCaretback to summary
public PDAnnotationCaret(COSDictionary field)

Creates a Caret 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
getRectDifferencesback to summary
public float[] getRectDifferences()

This will get the margin between the annotations "outer" rectangle defined by /Rect and the boundaries of the underlying caret.

Returns:float[]

the differences. If the entry hasn't been set am empty array is returned.

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

setRectDifferencesback to summary
public void setRectDifferences(float difference)

This will set the difference between the annotations "outer" rectangle defined by /Rect and boundaries of the underlying.

This will set an equal difference for all sides

Parameters
difference:float

from the annotations /Rect entry

setRectDifferencesback to summary
public void setRectDifferences(float differenceLeft, float differenceTop, float differenceRight, float differenceBottom)

This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.

Parameters
differenceLeft:float

left difference from the annotations /Rect entry

differenceTop:float

top difference from the annotations /Rect entry

differenceRight:float

right difference from the annotations /Rect entry

differenceBottom:float

bottom difference from the annotations /Rect entry