I need help:
I have the same problem as here: How to fill XFA form using iText?
"This document enabled extended features. This document was changed since it was created and using extended features isn't possible anymore."
I do not know how to use PdfStamper. Here is my code. Can you pls tell me how to use PdfStamper in my code.
Output PDF document is now read-only (I am not able to write in Fields), will PdfStamper also solve the read-only problem?
string DEST = "C:\\PDF\\code_empty1.pdf";
string SRC = "C:\\PDF\\code_empty.pdf";
string XML = "C:\\PDF\\code_emptyKopie.xml";
ManipulatePdfFill(DEST);
void ManipulatePdfFill(string dest)
{
PdfDocument pdfdoc = new PdfDocument(new PdfReader(SRC), new PdfWriter(dest));
PdfAcroForm form = PdfAcroForm.GetAcroForm(pdfdoc, true);
XfaForm xfa = form.GetXfaForm();
// Method fills this object with XFA data under datasets/data.
xfa.FillXfaForm(new FileStream(XML, FileMode.Open, FileAccess.Read));
xfa.Write(pdfdoc);
pdfdoc.Close();
}