resizeToFitText

open fun resizeToFitText(@NonNull annotationConfigurationRegistry: AnnotationConfigurationRegistry, @NonNull pageSize: Size)

Resizes the annotation to fit the text. This will update the bounding box of the annotation.

Parameters

annotationConfigurationRegistry

The annotation configuration registry to use for updating the annotation, can be retrieved by PdfFragment.getAnnotationConfigurationRegistry().

pageSize

The size of the page the annotation is on. Get it from PdfDocument.getPageSize(annotation.getPageIndex).