If you really want arbitrary text/font/color/etc in an annotation, you can build a PushbuttonField, use the Icon-Only style, and set that button's Icon to any ol PdfTemplate you like.
I use that trick a lot when building forms whose appearance doesn't fit into normal AcroForms. I draw their background into an icon-only button, then draw the data-entry portion on top (with transparent borders/background). This also lets me show-hide the entire "field", rather than just parts... without monkeying about with Optional Content Groups. --Mark Storer Senior Software Engineer Cardiff.com #include <disclaimer> typedef std::Disclaimer<Cardiff> DisCard; > -----Original Message----- > From: Leonard Rosenthol [mailto:[email protected]] > Sent: Wednesday, February 10, 2010 4:03 PM > To: 'Post all your questions about iText here' > Subject: Re: [iText-questions] How to underline/strikethru a FREETEXT > Annotation? > > > No, it is not possible with PDF in general (has nothing to do > with iText). > > You should consider using regular content (aka a Stamp) instead. > > -----Original Message----- > From: [email protected] [mailto:[email protected]] > Sent: Wednesday, February 10, 2010 6:21 PM > To: [email protected] > Subject: [iText-questions] How to underline/strikethru a > FREETEXT Annotation? > > I wonder if it is possible with iText to underline/strikethru > a FREETEXT PdfAnnotation. > > My current code: > > PdfContentByte pcb = new PdfContentByte(writer); > BaseFont font = FontFactory.getFont(BaseFont.HELVETICA, 20, > Font.STRIKETHRU).getCalculatedBaseFont(false); > pcb.setFontAndSize(font, 20); > pcb.setColorFill(BaseColor.RED); > > PdfAnnotation freeText = PdfAnnotation.createFreeText(writer, > new Rectangle(startX, startY, endX, endY), > "My text to underline", > pcb); > > writer.addAnnotation(freeText); > > Changing the style of the Font that I get from FontFactory > only works with BOLD and ITALIC - but not for UNDERLINE or STRIKETHRU. > > Could anybody please help me out there? How can I add an > underline for a FREETEXT Annotation (yes, it has to be an Annotation). > > Thank you very much! > -- > NEU: Mit GMX DSL über 1000,- ¿ sparen! > http://portal.gmx.net/de/go/dsl02 > > -------------------------------------------------------------- > ---------------- > SOLARIS 10 is the OS for Data Centers - provides features > such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.1t3xt.com/docs/book.php > Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
