/**
* @see com.itextpdf.text.pdf.PdfPageEventHelper#onGenericTag(
* com.itextpdf.text.pdf.PdfWriter,
* com.itextpdf.text.Document,
* com.itextpdf.text.Rectangle, java.lang.String)
*/
public override void OnGenericTag(PdfWriter writer,
Document document, Rectangle rect, string text)
{
PdfAnnotation annotation = new PdfAnnotation(writer,
new Rectangle(
rect.Right + 10, rect.Bottom,
rect.Right + 30, rect.Top
)
);
annotation.Title = "Text annotation";
annotation.Put(PdfName.SUBTYPE, PdfName.TEXT);
annotation.Put(PdfName.OPEN, PdfBoolean.PDFFALSE);
annotation.Put(PdfName.CONTENTS,
new PdfString(string.Format("Icon: {0}", text))
);
annotation.Put(PdfName.NAME, new PdfName(text));
writer.AddAnnotation(annotation);
}