See the examples in www.geocities.com/itextpdf that use PdfStamper. You can fill the fields one by one or create an FDF and fill them in one go.
Best Regards, Paulo Soares ----- Original Message ----- From: "Martin Abrahamsson" <[EMAIL PROTECTED]> To: "Paulo Soares" <[EMAIL PROTECTED]>; "Leonard Rosenthol" <[EMAIL PROTECTED]>; "[EMAIL PROTECTED] Sourceforge. Net" <[EMAIL PROTECTED]> Sent: Wednesday, July 30, 2003 16:21 Subject: SV: [iText-questions] Submitting acroform -----Ursprungligt meddelande----- Fr�n: Paulo Soares [mailto:[EMAIL PROTECTED] Skickat: den 30 juli 2003 17:02 Till: Martin Abrahamsson; Leonard Rosenthol; [EMAIL PROTECTED] Sourceforge. Net �mne: Re: [iText-questions] Submitting acroform >Now I understand. You want to create the PDF with fields in Acrobat, fill it >with iText and present the result to the user that has the option of >changing it and submitting the form. iText can do it out-of-the-box, no >problem. Ok, that's good news. I just don't realy understand how to do it. Before i had to copy the acrostuff i used the code below (selected parts) and this isn't working with rhe new acrofields. What do i have to du to copy the acrofields to the new pdf? Are there any examples to look at? (I havent found any yet) thanks again /Martin -- snip FileOutputStream stream = new FileOutputStream ("d:\\iText\\target\\ansokan_testar_form.pdf") PdfReader reader = new PdfReader("d:\\Dev\\pdf\\magic\\Ansokan_p_form.pdf"); Rectangle psize = reader.getPageSize(1); Document document = new Document(psize, 50, 50, 50, 50); PdfWriter writer = PdfWriter.getInstance (document, stream); document.open(); PdfContentByte cb = writer.getDirectContent(); PdfImportedPage page = writer.getImportedPage(reader, 1); cb.addTemplate(page,1,0,0,1,0,0); - adding text n' stuff - - document.close(); -- snip ----- Original Message ----- From: "Martin Abrahamsson" <[EMAIL PROTECTED]> To: "Paulo Soares" <[EMAIL PROTECTED]>; "Leonard Rosenthol" <[EMAIL PROTECTED]>; "[EMAIL PROTECTED] Sourceforge. Net" <[EMAIL PROTECTED]> Sent: Wednesday, July 30, 2003 13:31 Subject: SV: [iText-questions] Submitting acroform > Hi again > Thanks for the help so far. See below for more info/questions. > > > At 05:03 PM 7/29/2003 +0200, Martin Abrahamsson wrote: > > >I've created a couple och forms based on existing pdfs (scanned > forms) > > and > > >added acroformfields wich the user editds on screen and then prints > the > > >form. > > > > > Great... > > > > I've only done a couple of forms for a demo so far and it is a hassle > to > > get > > all the formfields in the exact possitions. To speed up things in the > > future > > (lots of forms to create) i'm wondering if it is posssible to add the > > acroformfields in acrobat and then read that form into itext and keep > > the > > formfields for the user to edit when i present it on screen. (this > line > > in > > the docs seems scary " parsing the content of a PDF-file is NOT > POSSIBLE > > with iText " but then there is the method getAcroForm() in > PdfReader...) > > >This is about the content like the text in the page, not the > interactive > >features as the acroforms. > > OK > > > Can > > I i any way use the getAcroForm() and then add it to my new > PdfDocument > > in > > som way? > > > > >I'm not sure about what you want. If you have other forms to create, > that I > >imagine will be different, what's the use of reading them into iText? > >Do you want to read existing forms and apply them to other documents? > >It's probably better to make a step by step workflow of what you > ideally > >pretend so that we (and maybe you) understand exactly what you want to > do. > > The forms i'm going to do is not realy different, i just don't want to > add > the acrofields in iText because it takes forever to find the exact > positions > for every field i need. I would be easier to add them in acrobat with > the > drag and drop functionality. This means they are already included in the > base pdf's i then read into iText. > > What i want to do is: > > 1. Read an existing pdf containing acroformfields into iText. > > 2. Add information from a database (personal information like name > adress > etc) to the pdf. Writing to acrofields or directly to the content byte. > > 3. Presenting the pdf to screen where the user enters text in the > acroformfields, and in stage 1(demo) prints the form. In stage 2 the the > enterd text in the acrofields is to be submitted back to the database > via > sevlet. > > The thing i'm not sure about is if it is possible to keep the > acroformfields > (and in stage 2 the submitbutton) from the original form that i read > into > iText so the user can enter text on screen after i've added the info > from > the database. > > > thanks > /Martin > ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
