# Remove form fields Remove form fields from PDF files to reduce file size using GroupDocs.Viewer's optimization options. If the output PDF file contains form fields, you can flatten them to reduce the file size. To remove form fields, set the [remove_form_fields](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfoptimizationoptions/#properties) property to `True`. The following code snippet shows how to flatten form fields in the file: {{< tabs "Example1">}} {{< tab "Python" >}} ```python from groupdocs.viewer import Viewer from groupdocs.viewer.options import PdfViewOptions, PdfOptimizationOptions def remove_form_fields(): # Load document with Viewer("order_form.pdf") as viewer: viewOptions = PdfViewOptions("remove_form_fields/without_form_fields.pdf") viewOptions.pdf_optimization_options = PdfOptimizationOptions() viewOptions.pdf_optimization_options.remove_form_fields = True viewer.view(viewOptions) if __name__ == "__main__": remove_form_fields() ``` {{< /tab >}} {{< tab "order_form.pdf" >}} {{< tab-text >}} `order_form.pdf` is the sample file used in this example. Click [here](https://docs.groupdocs.com/viewer/python-net/_sample_files/developer-guide/rendering-documents/rendering-to-pdf/optimization-pdf-options/optimize-content/optimization-pdf-remove-fields/order_form.pdf) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "without_form_fields.pdf" >}} ```text Binary file (PDF, 207 KB) ``` [Download full output](https://docs.groupdocs.com/viewer/python-net/_output_files/developer-guide/rendering-documents/rendering-to-pdf/optimization-pdf-options/optimize-content/optimization-pdf-remove-fields/remove_form_fields/without_form_fields.pdf) {{< /tab >}} {{< /tabs >}}