How to create Text Annotation with Oval shape border?

Product:

Product Version: 9.0177774

Hello

I am trying to create a custom tool to create Free Text annotation with oval / circular shape border. I have extended my class from Free text annotation but couldn’t find any documentation on how to add border to text anntation.

import com.pdftron.pdf.Annot
import com.pdftron.pdf.PDFViewCtrl
import com.pdftron.pdf.tools.FreeTextCreate
import com.pdftron.pdf.tools.ToolManager

class MarksAnnotation(ctrl: PDFViewCtrl) : FreeTextCreate(ctrl) {
    companion object {
        var MODE = ToolManager.ToolMode.addNewMode(Annot.e_FreeText)
    }


    override fun getToolMode(): ToolManager.ToolModeBase {
        return MODE
    }

    override fun createFreeText() {
        super.createFreeText()
    }
}

Another option I have tried is CalloutCreate but the shape is rectangular.

Below is the output I am looking for. (The red text with circle)
Screenshot 2021-08-25 at 11.18.58 PM

Kindly point me in the right direction to achive the same.

Thank You

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

This forum post shows how to edit the default appearances, so you can re-use the existing text layout logic, but change things like the border.

A possible improvement for your case, would be to make two annotations, a FreeText (with no border) and Circle, then read from both appearance streams and write to one single appearance, then discard the Circle and add the FreeText one to the page.

Note, that whenever you deviate from the default appearance, any future change to the annotation will result in it going back to the default appearance. For example, if someone later opens the PDF in another PDF viewer and edits the text, or resizes it, the round border would be lost.

I’ll try this solution. For now, I am using a different color to Text annotation. Will come back once tried.