addSquare

public final PdfSquareAnnotation addSquare(float x, float y, float width, float height, String author, String contents)

Adds a square (rectangle) annotation to this page. The annotation is created with default styling (1pt black border). Use the returned annotation's and properties to customize the appearance.

Return

The newly created .

Parameters

x

The x coordinate of the rectangle in points.

y

The y coordinate of the rectangle in points.

width

The width of the rectangle in points.

height

The height of the rectangle in points.

author

The author of the annotation.

contents

The text contents/comment for the annotation.

Throws

Thrown when no page is loaded.

Thrown when the operation fails.