I doesn't work that way. The sequence is:

- read the original pdf
- use the stamper to fill the fields
- close the stamper (you are advised to flatten the fields)
- read the pdf created by the stamper
- add it to PdfCopyFields

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Jesus Mercado
> Sent: Tuesday, March 21, 2006 4:54 PM
> To: [email protected]; [EMAIL PROTECTED]
> Subject: [iText-questions] pdfcopyfields
> 
> Hello,
>  
> My situation is as follows. I have one pdf file name 
> ScheduleA.pdf and it contains an Acroform with various 
> fields. Thru a program I need to load that page a certain 
> number of times set the values for the acrofields and then 
> concatonate all the SchedulesA.pdf files of that run. So 
> basicly I will end up with one pdf document containing 
> various ScheduleA files inside it and each with diferent data 
> on its Acrofields. I read in the forum that the class to use 
> for this should be pdfcopyfields but I'm gettin the error 
> document has been reused. Here is an extract of the code been 
> used. Any help will be greatly appreciated.
>  
> Dim memorystreamfields As System.IO.MemoryStream = New 
> System.IO.MemoryStream
> Dim fields As pdf.PdfCopyFields = New 
> pdf.PdfCopyFields(memorystreamfields)
>  
> Dim reader1 As iTextSharp.text.pdf.PdfReader = New 
> pdf.PdfReader(PDFURI)
> Dim reader2 As iTextSharp.text.pdf.PdfReader = New 
> pdf.PdfReader(PDFURI)
> Dim reader3 As iTextSharp.text.pdf.PdfReader = New 
> pdf.PdfReader(PDFURI)
> Dim reader4 As iTextSharp.text.pdf.PdfReader = New 
> pdf.PdfReader(PDFURI)
>  
> Dim memorystreamstamper As System.IO.MemoryStream = New 
> System.IO.MemoryStream
> Dim xfdfreadercopyfields1 As iTextSharp.text.pdf.XfdfReader = 
> New iTextSharp.text.pdf.XfdfReader(xfdfbytes)
>  
> Dim stamperpdfcopyfields As iTextSharp.text.pdf.PdfStamper = 
> New iTextSharp.text.pdf.PdfStamper(reader1, 
> memorystreamstamper, v, True)
> stamperpdfcopyfields.AcroFields.SetFields(xfdfreadercopyfields1)
>  
> <!-- repeat code above for al readers -->
>  
> fields.Open()
> fields.AddDocument(reader1) <------ Here I get the error message
> fields.AddDocument(reader2)
> fields.AddDocument(reader3)
>   
>  
> Thanks for your help.
> 
> ________________________________
> 
> Yahoo! Mail
> Use Photomail 
> <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=38867/*http:/
> /photomail.mail.yahoo.com>  to share photos without annoying 
> attachments.
> 


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to