See http://itextdocs.lowagie.com/tutorial/directcontent/pageevents/index.html. Look for onGenericTag().
Paulo ----- Original Message ----- From: "Midhun" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Thursday, April 26, 2007 1:35 PM Subject: [iText-questions] Creating Annotations through a program. > > Hi All, > > I am using iText to generate a PDF dynamically. The input is from a URL. > I > want to create annotations to the content. I know the text for which the > annotation needs to be made. But the text can appear anywhere in the PDF. > I > want to create annotations to this text. > > eg. If the content has the word "iText", I want to create annotation to > a > page explaining what iText is. But the word "iText" can be anywhere on the > page. > > The PdfAnnotation class requires the exact Rectangle dimensions. How do > I get the dimensions / position of the word "iText" at run time?? > > I have tried putting the content in a table and extracting the dimensions > using the getElement method (cast it to a Rectangle, although the > documentation says cell or table) and then use the bottom(), top(), left() > and right() methods. Unfortunately it didnt work - it gives all the values > as 0.0 > > Can anybody let me know if there is a way out?? > > Regards, > Midhun. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
