Skip to content

Commit ab5fab9

Browse files
Make Form Fields Visible/Printable by Default (#28)
* # Make Form Fields Visible by Default Explicitly set `/F` flag to 4 (Visible on Screen and Visible when Printed) for Textbox and Checkbox form fields. Otherwise the content of these form fields become invisible when the document is printed. * add venv to gitignore --------- Co-authored-by: Alphan Aksoyoglu <alphan.aksoyoglu@deliveryhero.com> Co-authored-by: Alphan Aksoyoglu <alphanbe@gmail.com>
1 parent 612ada4 commit ab5fab9

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ uv.lock
77
*.pdf
88
dist
99
models/
10+
.venv

commonforms/form_creator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def __init__(
6363
NameObject("/V"): TextStringObject(value or ""),
6464
NameObject("/DV"): TextStringObject(default_value or ""),
6565
NameObject("/Ff"): NumberObject(0 if not multiline else (1 << 12)),
66+
NameObject("/F"): NumberObject(4),
6667
NameObject("/Rect"): rect,
6768
NameObject("/DA"): TextStringObject("/Helv 0 Tf 0 0 0 rg"),
6869
}
@@ -88,6 +89,7 @@ def __init__(
8889
NameObject("/Subtype"): NameObject("/Widget"),
8990
NameObject("/FT"): NameObject("/Btn"),
9091
NameObject("/Ff"): NumberObject(0),
92+
NameObject("/F"): NumberObject(4),
9193
NameObject("/Rect"): rect,
9294
NameObject("/V"): pdf_value,
9395
NameObject("/AS"): pdf_value,

0 commit comments

Comments
 (0)