The names will stay the same but now you can fill them.
----- Original Message -----
From: "Vivek Mongulu" <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>
Sent: Wednesday, March 30, 2005 6:30 PM
Subject: Re: [iText-questions] pdf form help
> I searched the mailing list for XFA and followed the suggested steps
> and here's my new code
>
> PdfReader reader = new PdfReader("PDFTest.pdf");
> PdfDictionary acro = (PdfDictionary)PdfReader.getPdfObject(
> reader.getCatalog().get(PdfName.ACROFORM));
>
> acro.remove(new PdfName("XFA"));
> PdfStamper stamp = new PdfStamper(reader, new
> FileOutputStream("aNewPDF.pdf"));
>
> AcroFields af = stamp.getAcroFields();
> HashMap f = af.getFields();
>
> for (Iterator it = f.keySet().iterator(); it.hasNext();) {
> String name = (String)it.next();
> System.out.println("Field is " + name);
> }
>
> stamp.setFormFlattening(true);
> stamp.close();
>
> but still the field names are printed as
>
> Field is form1[0].#subform[0].FullName[0]
> Field is form1[0].#subform[0].FirstName[0]
> Field is form1[0].#subform[0].LastName[0]
> Field is form1[0].#subform[0].CheckBox1[0]
> Field is form1[0].#subform[0].CheckBox2[0]
> Field is form1[0].#subform[0].CheckBox3[0]
>
> instead of FullName, FirstName ....
>
> is there something else I should be doing? I am attaching the PDFTest.pdf
file
>
> Thanks in advance.
>
>
> On Tue, 29 Mar 2005 22:52:23 +0100, Paulo Soares <[EMAIL PROTECTED]>
wrote:
> > Search the mailing list for "XFA".
> >
> > ----- Original Message -----
> > From: "Vivek Mongulu" <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Tuesday, March 29, 2005 9:53 PM
> > Subject: [iText-questions] pdf form help
> >
> > > I have created a pdf form file using the Adobe designer. when I read
> > > the pdf form the form fields are being displayed as
> > >
> > > F1[0].P1[0].FNAME[0]
> > > F1[0].P1[0].CheckBox1[0]
> > >
> > > instead of just
> > >
> > > FNAME
> > > CheckBox1
> > >
> > > I want to set the fields and save it as a new pdf file. i am using
> > > PdfReader and PdfStamper. the problem is I'll have to use the fully
> > > qualifed name to set the fields. Wht am I doing wrong here. Is there
> > > another tool that I can use to create pdf form file.
> > >
> > > Thanks in advance.
> > >
> > >
> > > -------------------------------------------------------
> > > SF email is sponsored by - The IT Product Guide
> > > Read honest & candid reviews on hundreds of IT Products from real
users.
> > > Discover which products truly live up to the hype. Start reading now.
> > > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > > _______________________________________________
> > > iText-questions mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
>
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions