It doesn't work that way. PdfTemplate is a wrapper for a chunk of drawing commands and resources. No annotations of any sort.
Stuff To Know: *Field annotations with the same name share the same value. *They do this by sharing a common parent field that is not an annotation. *I'm not even sure iText will let you add the child fields properly. Let's see... Ah, looks like it will, but I'm not sure about it adding to multiple pages. If it doesn't work across multiple pages, come on back and I can walk you through the low level object code you'll need. --Mark Storer Senior Software Engineer Cardiff.com import legalese.Disclaimer; Disclaimer<Cardiff> DisCard = null; > -----Original Message----- > From: Michael Brewer-Davis [mailto:mich...@tech4learning.com] > Sent: Friday, April 30, 2010 4:11 PM > To: itext-questions@lists.sourceforge.net > Subject: [iText-questions] add PdfAnnotation (form field) to a PdfTemplate > > I'm trying to add the PdfAnnotation for a PushbuttonField to a > PdfTemplate object, so that I can repeat the button on each page of a > document. > > Is this something that I can do with a PdfTemplate? Or do I need to > back up and use a PdfStamper approach? > > PdfTemplate template = writer.getDirectContent() > .createTemplate(500, 500); > PushbuttonField button = new PushbuttonField(...); > ... > PdfAnnotation buttonField = button.getField(); > > // how to add? > writer.addAnnotation(buttonAnnotation); // adds to first page > > writer.releaseTemplate(template); > > writer.getDirectContent().addImage(Image.getInstance(template), ...); > > > Thanks much, > michael > > > ------------------------------------------------------------------------ -- > ---- > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.itextpdf.com/book/ > 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/ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.814 / Virus Database: 271.1.1/2842 - Release Date: 04/30/10 > 04:34:00 ------------------------------------------------------------------------------ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ 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/