Some test text!

Add free text annotation

Add a free text annotation to a PDF in Ruby

To add a free text annotation to a PDF Document page.

doc =
page = doc.GetPage(1)

# Create a free text
txtannot = FreeText.Create( doc.GetSDFDoc(),, 100, 350, 500)  )
txtannot.SetContentRect( 200, 200, 350, 500 ) )
txtannot.SetContents( "\n\nSome swift brown fox snatched a gray hare out of the air " +
            "by freezing it with an angry glare." +
            "\n\nAha!\n\nAnd there was much rejoicing!")
txtannot.SetCalloutLinePoints(,300),,290),,110) )
txtannot.SetBorderStyle( BorderStyle::E_solid, 1, 10, 20 ), false )
txtannot.SetEndingStyle( LineAnnot::E_ClosedArrow )
txtannot.SetColor( 0, 1, 0 ) )

Add or edit PDF annotations sample
Full code sample which shows how to add or edit PDF annotations (e.g. hyperlink, intra-document link, stamp, rubber stamp, file attachment, sound, text, free-text, line, circle, square, polygon, polyline, free text, squiggly, caret, and ink).

Get the answers you need: Support

PDFTron live tech update & run-through: Jan 20th at 11 am PT