Performs various operations on the form based on the specified parameters.
Param is a PdfParam object or parameter string containing various
Boolean parameters, all optional, including:
- RemoveXFA - this parameter is equivalent to calling the RemoveXFA method.
- Flatten - this parameter is equivalent to calling the Flatten method.
- FlattenAnnots - this parameter flattens items that are not technically form fields but
field-like annotations.
- RemoveJavaScript - this parameter removes all JavaScript from the document's catalog. This prevents the message "This PDF form
requires a newer version of Adobe Acrobat" from popping up.
- Reset - this parameter resets the current graphics state for all pages of the document. This may be useful
if the flattening procedure produces unexpected output or no output at all. This parameter was introduced in Version 3.4.0.30931.
This method was introduced in Version 2.9.
Usage:
PdfDocument objDoc = objPdf.OpenDocument(@"c:\path\1040nr.pdf");
objDoc.Form.Modify( "Flatten=true; RemoveJavaScript=true" );
objDoc.Save( @"c:\path\flattened.pdf" );
For more information, see Section 12.6 - JavaScript Removal and Other Features.