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 to share photos without annoying attachments.
