Search code examples
javaadobepdfclown

Build text callout with PDF Clown


the adobe acrobat reader have markup tool called "text callout".

It's possible to build with PDF Clown a object of this type?


Solution

  • The sample provided by the OP looks pretty much like the PDF Clown StaticNote with a StaticNote.CalloutLine.

    The relevant code from the AnnotationSample PDF Clown cli example are:

    // Callout.
    composer.showText("Callout note annotation:", new Point(35, 85));
    new StaticNote(
      page,
      new Rectangle(250, 90, 150, 70),
      "Text of the Callout note annotation"
      ).withLine(
         new StaticNote.CalloutLine(
           page,
           new Point(250,125),
           new Point(150,125),
           new Point(100,100)
           )
         )
       .withLineEndStyle(LineEndStyleEnum.OpenArrow)
       .withBorder(new Border(1))
       .withColor(DeviceRGBColor.get(Color.YELLOW));
    

    (From AnnotationSample.java)

    The output:

    screenshot of <code>AnnotationSample</code> result