setContentSize

open fun setContentSize(@Nullable contentSize: RectF, adjustedForPageRotation: Boolean)

Sets the inner bounds that are used when rotating the annotation. In order to keep the size consistent when rotating we need to remember the size when rotated 0° degrees.

Core adds the page rotation to the annotation rotation when handling stamps/free text rotation. So when creating them we can't use the bounding box to initialize the content size when the page they are on is 90° or 270°. We need to flip the width and height so it is correct. The adjustedForPageRotation parameter indicates whether this was already done by the calling code or if it should be done automatically when the annotation is attached to the document.

Parameters

contentSize

The content size to set in PDF coordinates.

adjustedForPageRotation

true if the content size was already adjusted for the page rotation, false if it should be adjusted as soon as the annotation is attached to the document.