public class RectangleAnnotation extends DrawingAnnotation
Modifier and Type | Method and Description |
---|---|
static RectangleAnnotation |
create(Document targetDocument,
Rectangle boundingBox,
Stroke stroke,
Paint fill)
Create a rectangle annotation.
|
static RectangleAnnotation |
createDynamicObject(long handle) |
Paint |
getFill()
The filling paint (Getter)
|
getPaint, getPopup
getInfo, getLocked, getReplies
copy, getBoundingBox, getHidden, getNoPrint, getNoRotate, getNoZoom
equals, hashCode
public static RectangleAnnotation createDynamicObject(long handle)
public static RectangleAnnotation create(Document targetDocument, Rectangle boundingBox, Stroke stroke, Paint fill)
targetDocument
- The output document with which the returned object is associated.boundingBox
- The location on the page.stroke
- The stroking parameters used for stroking the rectangle.
The stroking paint is used as the annotation's main paint.
If null
then the rectangle is not stroked.fill
- The paint used for filling the rectangle.
If null
then the rectangle is not filled.java.lang.IllegalArgumentException
- if the targetDocument
is null
java.lang.IllegalArgumentException
- if the targetDocument
has already been closedjava.lang.IllegalArgumentException
- if the targetDocument
is read-onlyjava.lang.IllegalArgumentException
- if the stroke
and fill
arguments are both null
java.lang.IllegalArgumentException
- if the stroke
argument is not associated with the targetDocument
java.lang.IllegalArgumentException
- if the stroke
's pdftoolbox.pdf.content.Stroke.getPaint
has a pdftoolbox.pdf.content.Paint.getColorSpace
other than a device color spacejava.lang.IllegalArgumentException
- if the stroke
's pdftoolbox.pdf.content.Stroke.getPaint
has a non-null
pdftoolbox.pdf.content.Paint.getTransparency
with pdftoolbox.pdf.content.Transparency.getBlendMode
other than pdftoolbox.pdf.content.BlendMode.NORMAL
java.lang.IllegalArgumentException
- if the stroke
argument's pdftoolbox.pdf.content.Stroke.getLineCapStyle
is other than pdftoolbox.pdf.content.LineCapStyle.BUTT
java.lang.IllegalArgumentException
- if the stroke
argument's pdftoolbox.pdf.content.Stroke.getLineJoinStyle
is other than pdftoolbox.pdf.content.LineJoinStyle.MITER
java.lang.IllegalArgumentException
- if the stroke
argument's pdftoolbox.pdf.content.Stroke.getMiterLimit
is other than 10java.lang.IllegalArgumentException
- if the stroke
argument's pdftoolbox.pdf.content.Stroke.getDashPhase
is other than 0java.lang.IllegalArgumentException
- if the fill
has a pdftoolbox.pdf.content.Paint.getColorSpace
other than a device color spacejava.lang.IllegalArgumentException
- if the fill
has a non-null
pdftoolbox.pdf.content.Paint.getTransparency
with pdftoolbox.pdf.content.Transparency.getBlendMode
other than pdftoolbox.pdf.content.BlendMode.NORMAL
java.lang.IllegalArgumentException
- if the fill
argument is not associated with the targetDocument
java.lang.IllegalArgumentException
- if boundingBox
is null
public Paint getFill()
java.lang.IllegalStateException
- if the object has already been closed