FlattenFormFields() Method
                                 
                                
                                    
                                        In This Topic
                                    
                                
                                Flattens all form fields included in the currently loaded PDF document. 
Flattening form fields means removing the form field objects from the document's internal structure and placing their data within the PDF document as regular items, so the previously defined form fields are no longer fillable or available for user's interaction.
 
            
            
            Syntax
            
        
            
            
            Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. 
We strongly recommend always checking this status first.
 
            
            
            
            
            
            Example
Flattening all form fields included in the current document.
            
             
    
	
		Using gdpicturePdf As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("document.pdf", False)
    gdpicturePDF.FlattenFormFields()
    MessageBox.Show("The number of form fields available: " + gdpicturePDF.GetFormFieldsCount(), "Flattening form fields", MessageBoxButtons.OK, MessageBoxIcon.Information)
    gdpicturePDF.SaveToFile("output.pdf")
End Using
	 
	
		using (GdPicturePDF gdpicturePdf = new GdPicturePDF())
{
    gdpicturePDF.LoadFromFile("document.pdf", false);
    gdpicturePDF.FlattenFormFields();
    MessageBox.Show("The number of form fields available: " + gdpicturePDF.GetFormFieldsCount(), "Flattening form fields", MessageBoxButtons.OK, MessageBoxIcon.Information);
    gdpicturePDF.SaveToFile("output.pdf");
}
	 
	
 
 
            
            Example
Flattening all form fields included in the current document.
            
            Using gdpicturePdf As GdPicturePDF = New GdPicturePDF()
                gdpicturePDF.LoadFromFile("document.pdf", False)
                gdpicturePDF.FlattenFormFields()
                MessageBox.Show("The number of form fields available: " + gdpicturePDF.GetFormFieldsCount(), "Flattening form fields", MessageBoxButtons.OK, MessageBoxIcon.Information)
                gdpicturePDF.SaveToFile("output.pdf")
            End Using
            using (GdPicturePDF gdpicturePdf = new GdPicturePDF())
            {
                gdpicturePDF.LoadFromFile("document.pdf", false);
                gdpicturePDF.FlattenFormFields();
                MessageBox.Show("The number of form fields available: " + gdpicturePDF.GetFormFieldsCount(), "Flattening form fields", MessageBoxButtons.OK, MessageBoxIcon.Information);
                gdpicturePDF.SaveToFile("output.pdf");
            }
            
            
            See Also