string Scr = @"D:\temp\notifications\ReadFrom\pdfSource.pdf"; string Dst = @"D:\temp\notifications\WriteTo\PdfDestination.pdf"; try { PdfReader reader = new PdfReader(Scr); //Source File using (FileStream ms = new FileStream(Dst, FileMode.OpenOrCreate, FileAccess.ReadWrite)) // Destination File Location { PdfStamper st = new PdfStamper(reader, ms); AcroFields fds = st.AcroFields; var keys = fds.Fields.Keys; foreach (string item in keys) { if (item.Contains(FieldName)) // && item.GetValue(FieldName) != DBValue { fds.SetField(item, UserEnteredFieldValue); //int i = fds.GetRevision(item); } } st.FormFlattening = true; st.Writer.CloseStream = false; st.Close(); } } catch (Exception ex) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)