How do I remove forms data from PDF?

Q: I would like to save PDF form file without form.
Effectively I would like to remove all forms data from PDF
How would I do this using PDFNet SDK?

A: Assuming that you what to flatten forms, you can use the following
line:

pdfdoc.FlattenAnnotations(true);
// Note: in older versions of PDFNet this method was called
FlattenForms()
pdfdoc.FlattenForms();

// optionally followed by
pdfdoc.GetRoot().Erase(“AcroForm”);


pdfdoc.Save (…);