File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ writer.update_page_form_field_values(
3636 writer.pages[0],
3737 {"fieldname": "some filled in text"},
3838 auto_regenerate=False,
39+ flatten=False,
3940)
4041
4142writer.write("out-filled-form.pdf")
@@ -46,6 +47,12 @@ parameter is `True` by default for legacy compatibility, but this flags the PDF
4647processor to recompute the field's rendering, and may trigger a "save changes"
4748dialog for users who open the generated PDF.
4849
50+ If you want to flatten your form, that is, keeping all form field contents while
51+ removing the form fields themselves, you can set ` flatten=True ` to convert form
52+ field contents to regular PDF content, and then use
53+ ` writer.remove_annotations(subtypes="/Widget") ` to remove all form fields. This
54+ will result in a flattened PDF.
55+
4956## Some notes about form fields and annotations
5057
5158PDF forms have a dual-nature approach to the fields:
You can’t perform that action at this time.
0 commit comments