Java Mailing List Archive

http://www.junlu.com/

Home » Post all your questions about iText here »

Re: [iText-questions] PDF Form with AcroFields in loop in multiple
 pages

Mark Storer

2010-03-15

Replies: Find Java Web Hosting

Author LoginPost Reply
The PDF does indeed specify that all the fields should be on the last
page. I thought there might be some hierarchy issue here, but you've
got a proper parent/kids thing going on.

HOWEVER, if you want two fields with the same name, you need to create a
parent field with that name (and the shared value), and make the
instance fields unnamed kids, which I didn't see when I cracked open
your form.

It looks like you're using document events to add your fields, but
they're all getting added at the end of document.

I suspect you're building your PdfFormField (or BaseField-derived)
objects in the event, but not adding them to the PDF until the document
is closed.

You need to call writer.addAnnotation( PdfAnnotation annot ) while
you're still on the page on which you want the field to appear, in the
OnEndPage event would be good.

Note that while PdfWriter.addAnnotation( PdfAnnotation annot, int page )
is present (though not public? Makes sense I guess), the int argument is
Completely Ignored in the base PdfWriter class. It's there, presumably,
to be overridden by subclasses (and to confuse people who don't look at
the source (ie: most people (like you (this is starting to look like
LISP ( yuck! ) ) ) ) ).


--Mark Storer
Senior Software Engineer
Cardiff.com

#include <disclaimer>
typedef std::disclaimer<Cardiff> Discard;

> -----Original Message-----
> From: munish_sharma [mailto:munish.sharma@(protected)]
> Sent: Saturday, March 13, 2010 1:30 AM
> To: itext-questions@(protected)
> Subject: [iText-questions] PDF Form with AcroFields in loop in
multiple
> pages
>
>
> I want to repeat some fields using Acrofields in loop. It works file
fine
> within single page but gives trouble when invloves more than one page
(All
> acrofields moves to last page) .Please suggest how could i create a
form
> with multiple pages.
>
> Thanx
> Munish http://old.nabble.com/file/p27886548/PDFForm.pdf PDFForm.pdf
>
> P.S Plese check attached PDF file
> --
> View this message in context: http://old.nabble.com/PDF-Form-with-
> AcroFields-in-loop-in-multiple-pages-tp27886548p27886548.html
> Sent from the iText - General mailing list archive at Nabble.com.
>
>
>
------------------------------------------------------------------------
--
> ----
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> iText-questions mailing list
> iText-questions@(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/
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.733 / Virus Database: 271.1.1/2732 - Release Date:
03/15/10
> 00:33:00

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
iText-questions@(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/
©2008 junlu.com - Jax Systems, LLC, U.S.A.