Thank you        

Revised code:

public static byte[] SetFormData(byte[] filedata, Dictionary<string, string>
formdata)
        {
            var reader = new PdfReader(filedata);
            var ms = new MemoryStream();
            var stamper = new PdfStamper(reader, ms, '0', true);

            var fields = stamper.AcroFields;
            foreach (var key in formdata.Keys)
            {
                fields.SetField(key, formdata[key]);
            }

            stamper.Close();
            reader.Close();
            return ms.ToArray();
        }

Works like a charm.

Regards
Högni
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Section-8-7-Corrupt-output-tp3264228p3264263.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to