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

public Class PDAnnotationLine

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

This is the class that represents a line annotation. Introduced in PDF 1.3 specification
Author
Paul King

Field Summary

Modifier and TypeField and Description
private PDAppearanceHandler
public static final String
IT_LINE_ARROW

Constant for annotation intent of Arrow.

public static final String
IT_LINE_DIMENSION

Constant for annotation intent of a dimension line.

public static final String
LE_BUTT

Constant for a butt line ending.

public static final String
LE_CIRCLE

Constant for a circle line ending.

public static final String
LE_CLOSED_ARROW

Constant for a closed arrow line ending.

public static final String
LE_DIAMOND

Constant for a diamond line ending.

public static final String
LE_NONE

Constant for no line ending.

public static final String
LE_OPEN_ARROW

Constant for a open arrow line ending.

public static final String
LE_R_CLOSED_ARROW

Constant for a reversed closed arrow line ending.

public static final String
LE_R_OPEN_ARROW

Constant for a reversed open arrow line ending.

public static final String
LE_SLASH

Constant for a slash line ending.

public static final String
LE_SQUARE

Constant for a square line ending.

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
PDAnnotationLine()

Constructor.

public
PDAnnotationLine(COSDictionary
the PDF object to represent as a field.
field
)

Creates a Line 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 horizontal offset of the caption
getCaptionHorizontalOffset
()

This will retrieve the horizontal offset of the caption.

public String

Returns:

the caption positioning
getCaptionPositioning
()

This will retrieve the caption positioning.

public float

Returns:

the vertical offset of the caption
getCaptionVerticalOffset
()

This will retrieve the vertical offset of the caption.

public String

Returns:

The ending style for the end point, LE_NONE if missing, never null.
getEndPointEndingStyle
()

This will retrieve the line ending style for the end point, possible values shown in the LE_ constants section.

public PDColor

Returns:

object representing the color.
getInteriorColor
()

This will retrieve the interior color of the line endings defined in the LE entry.

public float

Returns:

the length of the leader line extensions
getLeaderLineExtensionLength
()

This will retrieve the length of the leader line extensions.

public float

Returns:

the length of the leader line
getLeaderLineLength
()

This will retrieve the length of the leader line.

public float

Returns:

the length of the leader line offset
getLeaderLineOffsetLength
()

This will retrieve the length of the leader line offset.

public float[]

Returns:

array of floats [x1, y1, x2, y2] line start and end points in default user space.
getLine
()

This will retrieve the start and end coordinates of the line (or leader line if LL entry is set).

public String

Returns:

The ending style for the start point, LE_NONE if missing, never null.
getStartPointEndingStyle
()

This will retrieve the line ending style for the start point, possible values shown in the LE_ constants section.

public boolean

Returns:

boolean if the contents shall be shown as a caption (default: false).
hasCaption
()

This will retrieve whether the text specified by the /Contents or /RC entries shall be shown as a caption in the appearance of the line.

public void
setCaption(boolean
Boolean value.
cap
)

This will set if the contents are shown as a caption to the line.

public void
setCaptionHorizontalOffset(float
the horizontal offset of the caption
offset
)

This will set the horizontal offset of the caption.

public void
setCaptionPositioning(String
caption positioning
captionPositioning
)

This will set the caption positioning.

public void
setCaptionVerticalOffset(float
vertical offset of the caption
offset
)

This will set the vertical offset of the caption.

public void
setCustomAppearanceHandler(PDAppearanceHandler
custom appearance handler
appearanceHandler
)

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

public void
setEndPointEndingStyle(String
The new style.
style
)

This will set the line ending style for the end point, see the LE_ constants for the possible values.

public void
setInteriorColor(PDColor
color in the DeviceRGB color space.
ic
)

This will set interior color of the line endings defined in the LE entry.

public void
setLeaderLineExtensionLength(float
length of the leader line extensions
leaderLineExtensionLength
)

This will set the length of the leader line extensions.

public void
setLeaderLineLength(float
length of the leader line
leaderLineLength
)

This will set the length of the leader line.

public void
setLeaderLineOffsetLength(float
length of the leader line offset
leaderLineOffsetLength
)

This will set the length of the leader line offset.

public void
setLine(float[]
array of 4 floats [x1, y1, x2, y2] line start and end points in default user space.
l
)

This will set start and end coordinates of the line (or leader line if LL entry is set).

public void
setStartPointEndingStyle(String
The new style.
style
)

This will set the line ending style for the start point, see the LE_ constants for the possible values.

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

Field Detail

customAppearanceHandlerback to summary
private PDAppearanceHandler customAppearanceHandler
IT_LINE_ARROWback to summary
public static final String IT_LINE_ARROW

Constant for annotation intent of Arrow.

IT_LINE_DIMENSIONback to summary
public static final String IT_LINE_DIMENSION

Constant for annotation intent of a dimension line.

LE_BUTTback to summary
public static final String LE_BUTT

Constant for a butt line ending.

LE_CIRCLEback to summary
public static final String LE_CIRCLE

Constant for a circle line ending.

LE_CLOSED_ARROWback to summary
public static final String LE_CLOSED_ARROW

Constant for a closed arrow line ending.

LE_DIAMONDback to summary
public static final String LE_DIAMOND

Constant for a diamond line ending.

LE_NONEback to summary
public static final String LE_NONE

Constant for no line ending.

LE_OPEN_ARROWback to summary
public static final String LE_OPEN_ARROW

Constant for a open arrow line ending.

LE_R_CLOSED_ARROWback to summary
public static final String LE_R_CLOSED_ARROW

Constant for a reversed closed arrow line ending.

LE_R_OPEN_ARROWback to summary
public static final String LE_R_OPEN_ARROW

Constant for a reversed open arrow line ending.

LE_SLASHback to summary
public static final String LE_SLASH

Constant for a slash line ending.

LE_SQUAREback to summary
public static final String LE_SQUARE

Constant for a square line ending.

SUB_TYPEback to summary
public static final String SUB_TYPE

The type of annotation.

Constructor Detail

PDAnnotationLineback to summary
public PDAnnotationLine()

Constructor.

PDAnnotationLineback to summary
public PDAnnotationLine(COSDictionary field)

Creates a Line 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
getCaptionHorizontalOffsetback to summary
public float getCaptionHorizontalOffset()

This will retrieve the horizontal offset of the caption.

Returns:float

the horizontal offset of the caption

getCaptionPositioningback to summary
public String getCaptionPositioning()

This will retrieve the caption positioning.

Returns:String

the caption positioning

getCaptionVerticalOffsetback to summary
public float getCaptionVerticalOffset()

This will retrieve the vertical offset of the caption.

Returns:float

the vertical offset of the caption

getEndPointEndingStyleback to summary
public String getEndPointEndingStyle()

This will retrieve the line ending style for the end point, possible values shown in the LE_ constants section.

Returns:String

The ending style for the end point, LE_NONE if missing, never null.

getInteriorColorback to summary
public PDColor getInteriorColor()

This will retrieve the interior color of the line endings defined in the LE entry. color is in DeviceRGB color space.

Returns:PDColor

object representing the color.

getLeaderLineExtensionLengthback to summary
public float getLeaderLineExtensionLength()

This will retrieve the length of the leader line extensions.

Returns:float

the length of the leader line extensions

getLeaderLineLengthback to summary
public float getLeaderLineLength()

This will retrieve the length of the leader line.

Returns:float

the length of the leader line

getLeaderLineOffsetLengthback to summary
public float getLeaderLineOffsetLength()

This will retrieve the length of the leader line offset.

Returns:float

the length of the leader line offset

getLineback to summary
public float[] getLine()

This will retrieve the start and end coordinates of the line (or leader line if LL entry is set).

Returns:float[]

array of floats [x1, y1, x2, y2] line start and end points in default user space.

getStartPointEndingStyleback to summary
public String getStartPointEndingStyle()

This will retrieve the line ending style for the start point, possible values shown in the LE_ constants section.

Returns:String

The ending style for the start point, LE_NONE if missing, never null.

hasCaptionback to summary
public boolean hasCaption()

This will retrieve whether the text specified by the /Contents or /RC entries shall be shown as a caption in the appearance of the line.

Returns:boolean

boolean if the contents shall be shown as a caption (default: false).

setCaptionback to summary
public void setCaption(boolean cap)

This will set if the contents are shown as a caption to the line.

Parameters
cap:boolean

Boolean value.

setCaptionHorizontalOffsetback to summary
public void setCaptionHorizontalOffset(float offset)

This will set the horizontal offset of the caption.

Parameters
offset:float

the horizontal offset of the caption

setCaptionPositioningback to summary
public void setCaptionPositioning(String captionPositioning)

This will set the caption positioning. Allowed values are: "Inline" and "Top"

Parameters
captionPositioning:String

caption positioning

setCaptionVerticalOffsetback to summary
public void setCaptionVerticalOffset(float offset)

This will set the vertical offset of the caption.

Parameters
offset:float

vertical offset of the caption

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

setEndPointEndingStyleback to summary
public void setEndPointEndingStyle(String style)

This will set the line ending style for the end point, see the LE_ constants for the possible values.

Parameters
style:String

The new style.

setInteriorColorback to summary
public void setInteriorColor(PDColor ic)

This will set interior color of the line endings defined in the LE entry. color is in DeviceRGB color space.

Parameters
ic:PDColor

color in the DeviceRGB color space.

setLeaderLineExtensionLengthback to summary
public void setLeaderLineExtensionLength(float leaderLineExtensionLength)

This will set the length of the leader line extensions.

Parameters
leaderLineExtensionLength:float

length of the leader line extensions

setLeaderLineLengthback to summary
public void setLeaderLineLength(float leaderLineLength)

This will set the length of the leader line.

Parameters
leaderLineLength:float

length of the leader line

setLeaderLineOffsetLengthback to summary
public void setLeaderLineOffsetLength(float leaderLineOffsetLength)

This will set the length of the leader line offset.

Parameters
leaderLineOffsetLength:float

length of the leader line offset

setLineback to summary
public void setLine(float[] l)

This will set start and end coordinates of the line (or leader line if LL entry is set).

Parameters
l:float[]

array of 4 floats [x1, y1, x2, y2] line start and end points in default user space.

setStartPointEndingStyleback to summary
public void setStartPointEndingStyle(String style)

This will set the line ending style for the start point, see the LE_ constants for the possible values.

Parameters
style:String

The new style.