I am having a few issues with SetFields().  I am using the iTextSharp .net
library, but hoping I may be able to get help with issue I am having.  The
form is being posted to an .net aspx screen, where I am getting the fdf data
and putting it back together and flatting the pdf.  The sample pdf was
created in acrobat pro and I am using iTextSharp 5.0.1.1.

The sample pdf has a simple listbox, with multiselect on and a submit
button.

So my issues
1. Multi-Selection not holding, only last Selected item gets selected when
call SetFields
         If I select 2 options and submit the form it only re-selectes the last
option I selected.  So if I Select item1 and item3 and post the pdf to the
code below the flattened pdf only shows item3 selected.
         If i select item1 and item2, only item2 will show up selected.  Its 
always
the last item that was selected that wins.  This problem only occurs when
more than 1 item is selected.

2. Options disappearing.
   If i only select 1 option, item2 and post the page, the flattend pdf
selects the correct item, but any items above the selected Item disappear. 
So the flattened pdf only shows two option item2 and item3 and item2 is
selection.  If i select item3 and post the page, it only shows item3, item1
and item2 disappear  on the flattend pdf.  The problem only occurs when 1
item is selected.

Hoping I am just missing a step or have something wrong with my code, any
help would be greatly appricated.

http://old.nabble.com/file/p28169721/test.pdf test.pdf 

--Code

            'Create Memory Steam
            Dim MemStream As New System.IO.MemoryStream

            'Open PDF Reader
            Dim opdfReader As iTextSharp.text.pdf.PdfReader = New
iTextSharp.text.pdf.PdfReader("test.pdf")
            Dim opdfStamper As iTextSharp.text.pdf.PdfStamper = New
PdfStamper(opdfReader, MemStream)

            'Get FDF Reader from Stream
            Dim ofdfReader As New
iTextSharp.text.pdf.FdfReader(Request.InputStream)

            Dim pdfform As AcroFields = opdfStamper.AcroFields
            pdfform.SetFields(ofdfReader)

            opdfStamper.FormFlattening = True
            opdfStamper.Writer.CloseStream = False
            opdfStamper.Close()

            'Send Resposne
            Response.Buffer = True
            Response.ContentType = "application/pdf"
            Response.AddHeader("Content-Disposition", "inline")
            MemStream.WriteTo(Response.OutputStream)
            Response.OutputStream.Flush()
            Response.OutputStream.Close()
            MemStream.Close()
-- 
View this message in context: 
http://old.nabble.com/SetFields-Issue---Using-iTextSharp-tp28169721p28169721.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to