Thanks for the reply.

This is , in fact, a major roadblock for us to move forward..

Could you please elaborate on, how I can process  the document page by
Page?
Also, Is there a way to find out, which Page the PdfWriter is actually at ?
Is there a way to set the PdfWriter to a specific page?

Thanks A Lot,

Aniths



|---------+------------------------------------------->
|         |           ""S�lter, Peter""               |
|         |           <[EMAIL PROTECTED]>     |
|         |           Sent by:                        |
|         |           [EMAIL PROTECTED]|
|         |           ceforge.net                     |
|         |                                           |
|         |                                           |
|         |           06/01/2005 04:39 AM             |
|         |                                           |
|---------+------------------------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                 |
  |       To:       "'[email protected]'" 
<[email protected]>                            |
  |       cc:                                                                   
                                                 |
  |       Subject:  AW: [iText-questions] How to insert pdf form fields in 
different pages??                                     |
  
>------------------------------------------------------------------------------------------------------------------------------|




Hi Anitha,
you'll have to process one page after the other and do the
formfield.setPage()
on every page the PdfWriter is actually at.

In your code the PDfWriter is already on the last page.
Therefore all fields appear on this page.

Maybe you could write your own XML-parsing code and iterate through the
pages.

Greetings,
Peter

-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Paulo
Soares
Gesendet: Dienstag, 31. Mai 2005 18:02
An: [EMAIL PROTECTED]; [email protected];
[EMAIL PROTECTED]
Betreff: RE: [iText-questions] How to insert pdf form fields in different
pages??


That won't work with XML.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Tuesday, May 31, 2005 12:32 PM
> To: [email protected];
> [EMAIL PROTECTED]
> Subject: [iText-questions] How to insert pdf form fields in
> different pages??
>
>
>
>
>
> Hi,
> I am trying ton insert pdfForm fields in a  5 page Document. One
> field, I need to isert in the 4th page and the rest in page5.
>
> This is the code snippet, I use for the same..
> But, even if I specify the page Number as 4 and 5, all the
> form fields,
> comes in the last(5th) page only.
> Could you please help.?
>
>
> --------------------------------------------------------------
> --------------------------------------------------------------
> ------------------
>
> document = new Document();
> baos = new ByteArrayOutputStream();
> writer = PdfWriter.getInstance(document, baos);
> writer.getPageNumber();
>
> SAXiTextHandler saxItextHandler = new SAXiTextHandler(document);
> saxItextHandler.setControlOpenClose(false);
> saxItextHandler.startDocument();
> document.open();
>
> SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
> parser.parse(new ByteArrayInputStream(pdfContents.getBytes()),
> saxItextHandler);
>
> Rectangle rect = null;
> Color color = new Color(0,0,120);
> BaseFont bf  =
> FontFactory.getFont(FontFactory.HELVETICA_OBLIQUE).getBaseFont();
> //.getCalculatedBaseFont(false);
>
>
> //First Form Field
>
> rect = new Rectangle(10, 10, 10, 10);
> TextField tf = new TextField(writer,rect, "fmField1");
> tf.setTextColor(color);
> tf.setFont(bf);
> PdfFormField formField2 = tf.getTextField();
> formField2.setWidget(rect, PdfAnnotation.HIGHLIGHT_NONE);
> formField2.setFlags(PdfAnnotation.FLAGS_PRINT);
> formField2.setFieldName("fmField1");
> formField2.setPage(4);
> writer.addAnnotation(formField2);
>
> //second form field.
> rect = new Rectangle(10, 10, 10, 10);
> tf = new TextField(writer,rect, "fmField2");
> tf.setTextColor(color);
> tf.setFont(bf);
> PdfFormField formField3 = tf.getTextField();
> formField3.setWidget(rect, PdfAnnotation.HIGHLIGHT_NONE);
> formField3.setFlags(PdfAnnotation.FLAGS_PRINT);
> formField3.setFieldName("fmField2");
> formField3.setPage(5);
> writer.addAnnotation(formField3);
>
>
> --------------------------------------------------------------
> --------------------------------------------------------------
> --------------------
>
> Thanks,
> Anitha
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit
> http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
> _______________________________________________
> iText-questions mailing list [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
iText-questions mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions







-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r 
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to