addFreeText

public final PdfFreeTextAnnotation addFreeText(float x, float y, float width, float height, String author, String contents, String fontName, float fontSize, Color fontColor)

Adds a free text annotation (text box) to this page. The annotation is created with a default white background. Use the returned annotation's property to customize the fill color.

Return

The newly created .

Parameters

x

The x coordinate of the text box in points.

y

The y coordinate of the text box in points.

width

The width of the text box in points.

height

The height of the text box in points.

author

The author of the annotation.

contents

The text contents to display.

fontName

The name of the font to use.

fontSize

The size of the font in points.

fontColor

The color of the text.

Throws

Thrown when no page is loaded.

Thrown when the operation fails.