Skip to content

Commit cfae3a6

Browse files
DOC: Notes about update_page_form_field_values(auto_regenerate) (#2359)
Co-authored-by: dmjohnsson23 <dmjohn235@gmail.com>
1 parent 0a79b3c commit cfae3a6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/user/forms.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@ fields = reader.get_fields()
2727
writer.append(reader)
2828

2929
writer.update_page_form_field_values(
30-
writer.pages[0], {"fieldname": "some filled in text"}
30+
writer.pages[0],
31+
{"fieldname": "some filled in text"},
32+
auto_regenerate=False,
3133
)
3234

3335
# write "output" to pypdf-output.pdf
3436
with open("filled-out.pdf", "wb") as output_stream:
3537
writer.write(output_stream)
3638
```
39+
40+
Generally speaking, you will always want to use `auto_regenerate=False`. The
41+
parameter is `True` by default for legacy compatibility, but this flags the PDF
42+
Viewer to recompute the field's rendering, and may trigger a "save changes"
43+
dialog for users who open the generated PDF.

0 commit comments

Comments
 (0)