private void fillForm() { try { string formFile = Server.MapPath("") + @"\Forms\fw4.pdf"; string savepath = Server.MapPath("") + @"\Forms\new_fw4.pdf"; PdfReader pdfReader = new PdfReader(formFile); using (FileStream stream = new FileStream(savepath, FileMode.Create)) { PdfStamper pdfStamper = new PdfStamper(pdfReader, stream); AcroFields formFields = pdfStamper.AcroFields; foreach (DictionaryEntry de in formFields.Fields) { formFields.SetField("field name", "field value"); } pdfStamper.FormFlattening = true; pdfStamper.Close(); } } catch { } }
Cannot convert type 'System.Collections.Generic.KeyValuePair<string,iTextSharp.text.pdf.AcroFields.Item>' to 'System.Collections.DictionaryEntry'
DictionaryEntry
KeyValuePair<string,iTextSharp.text.pdf.AcroFields.Item>
KeyValuePair<string, object>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)