Class LineAnnotation
- java.lang.Object
-
public class LineAnnotation extends DrawingAnnotation
A line annotation
An annotation that draws a line on a page.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LineAnnotation
create(Document targetDocument, Point start, Point end, Stroke stroke)
Create a line annotation.Point
getEnd()
The line's ending point (Getter)LineEnding
getEndStyle()
The ending point's style (Getter)Paint
getLineEndingFill()
The line ending filling paint (Getter)Point
getStart()
The line's starting point (Getter)LineEnding
getStartStyle()
The starting point's style (Getter)-
Methods inherited from class com.pdftools.toolbox.pdf.annotations.DrawingAnnotation
getPaint, getPopup
-
Methods inherited from class com.pdftools.toolbox.pdf.annotations.MarkupAnnotation
getInfo, getLocked, getReplies
-
Methods inherited from class com.pdftools.toolbox.pdf.annotations.Annotation
copy, getBoundingBox, getHidden, getId, getNoPrint, getNoRotate, getNoZoom
-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
create
public static LineAnnotation create(Document targetDocument, Point start, Point end, Stroke stroke)
Create a line annotation.
The returned line annotation is not yet part of any page. It can be added to a page's list of annotations.- Parameters:
targetDocument
- The output document with which the returned object is associated.start
- The line's start point.end
- The line's end point.stroke
- The stroking parameters used for stroking the line. The stroking paint is used as the annotation's main paint.- Returns:
- The newly created line annotation.
- Throws:
java.lang.IllegalArgumentException
- if thetargetDocument
has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
is read-onlyjava.lang.IllegalArgumentException
- if thestroke
argument is not associated with thetargetDocument
java.lang.IllegalArgumentException
- if thestroke
'stoolbox.pdf.content.Stroke.getPaint
has atoolbox.pdf.content.Paint.getColorSpace
other than a device color spacejava.lang.IllegalArgumentException
- if thestroke
'stoolbox.pdf.content.Stroke.getPaint
has a non-null
toolbox.pdf.content.Paint.getTransparency
withtoolbox.pdf.content.Transparency.getBlendMode
other thantoolbox.pdf.content.BlendMode.NORMAL
java.lang.IllegalArgumentException
- if thestroke
argument'stoolbox.pdf.content.Stroke.getLineCapStyle
is other thantoolbox.pdf.content.LineCapStyle.BUTT
java.lang.IllegalArgumentException
- if thestroke
argument'stoolbox.pdf.content.Stroke.getLineJoinStyle
is other thantoolbox.pdf.content.LineJoinStyle.MITER
java.lang.IllegalArgumentException
- if thestroke
argument'stoolbox.pdf.content.Stroke.getMiterLimit
is other than 10java.lang.IllegalArgumentException
- if thestroke
argument'stoolbox.pdf.content.Stroke.getDashPhase
is other than 0java.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- ifstart
isnull
java.lang.IllegalArgumentException
- ifend
isnull
java.lang.IllegalArgumentException
- ifstroke
isnull
-
getStart
public Point getStart()
The line's starting point (Getter)
- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
getEnd
public Point getEnd()
The line's ending point (Getter)
- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
getStartStyle
public LineEnding getStartStyle()
The starting point's style (Getter)
- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
getEndStyle
public LineEnding getEndStyle()
The ending point's style (Getter)
- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
getLineEndingFill
public Paint getLineEndingFill()
The line ending filling paint (Getter)
This paint applies to both the starting end the ending point.- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
-