PyPDFForm 1.4.32__py3-none-any.whl → 1.4.33__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of PyPDFForm might be problematic. Click here for more details.
- PyPDFForm/__init__.py +1 -1
- PyPDFForm/image.py +1 -1
- PyPDFForm/patterns.py +15 -3
- PyPDFForm/widgets/base.py +3 -1
- PyPDFForm/widgets/text.py +1 -1
- {PyPDFForm-1.4.32.dist-info → PyPDFForm-1.4.33.dist-info}/METADATA +1 -1
- {PyPDFForm-1.4.32.dist-info → PyPDFForm-1.4.33.dist-info}/RECORD +10 -10
- {PyPDFForm-1.4.32.dist-info → PyPDFForm-1.4.33.dist-info}/LICENSE +0 -0
- {PyPDFForm-1.4.32.dist-info → PyPDFForm-1.4.33.dist-info}/WHEEL +0 -0
- {PyPDFForm-1.4.32.dist-info → PyPDFForm-1.4.33.dist-info}/top_level.txt +0 -0
PyPDFForm/__init__.py
CHANGED
PyPDFForm/image.py
CHANGED
|
@@ -42,7 +42,7 @@ def any_image_to_jpg(image_stream: bytes) -> bytes:
|
|
|
42
42
|
return image_stream
|
|
43
43
|
|
|
44
44
|
rgb_image = Image.new("RGB", image.size, (255, 255, 255))
|
|
45
|
-
rgb_image.paste(image, mask=image.split()[3])
|
|
45
|
+
rgb_image.paste(image, mask=image.split()[3] if len(image.split()) == 4 else None)
|
|
46
46
|
|
|
47
47
|
with BytesIO() as _file:
|
|
48
48
|
rgb_image.save(_file, format="JPEG")
|
PyPDFForm/patterns.py
CHANGED
|
@@ -5,8 +5,8 @@ from pypdf.generic import (DictionaryObject, NameObject, NumberObject,
|
|
|
5
5
|
TextStringObject)
|
|
6
6
|
|
|
7
7
|
from .constants import (AP, AS, CA, DA, DV, FT, IMAGE_FIELD_IDENTIFIER, JS, MK,
|
|
8
|
-
READ_ONLY, A, Btn, Ch, Ff, N, Off, Opt,
|
|
9
|
-
T, Tx, V, Yes)
|
|
8
|
+
MULTILINE, READ_ONLY, A, Btn, Ch, Ff, N, Off, Opt,
|
|
9
|
+
Parent, Q, Sig, T, Tx, V, Yes)
|
|
10
10
|
from .middleware.checkbox import Checkbox
|
|
11
11
|
from .middleware.dropdown import Dropdown
|
|
12
12
|
from .middleware.image import Image
|
|
@@ -166,4 +166,16 @@ def update_created_text_field_alignment(annot: DictionaryObject, val: int) -> No
|
|
|
166
166
|
annot[NameObject(Q)] = NumberObject(val)
|
|
167
167
|
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
def update_created_text_field_multiline(annot: DictionaryObject, val: bool) -> None:
|
|
170
|
+
"""Patterns to update to multiline for text annotations created by the library."""
|
|
171
|
+
|
|
172
|
+
if val:
|
|
173
|
+
annot[NameObject(Ff)] = NumberObject(
|
|
174
|
+
int(annot[NameObject(Ff)]) | MULTILINE # noqa
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
NON_ACRO_FORM_PARAM_TO_FUNC = {
|
|
179
|
+
("TextWidget", "alignment"): update_created_text_field_alignment,
|
|
180
|
+
("TextWidget", "multiline"): update_created_text_field_multiline,
|
|
181
|
+
}
|
PyPDFForm/widgets/base.py
CHANGED
|
@@ -59,7 +59,9 @@ class Widget:
|
|
|
59
59
|
|
|
60
60
|
for each in self.ALLOWED_NON_ACRO_FORM_PARAMS:
|
|
61
61
|
if each in kwargs:
|
|
62
|
-
self.non_acro_form_params.append(
|
|
62
|
+
self.non_acro_form_params.append(
|
|
63
|
+
((type(self).__name__, each), kwargs.get(each))
|
|
64
|
+
)
|
|
63
65
|
|
|
64
66
|
def watermarks(self, stream: bytes) -> List[bytes]:
|
|
65
67
|
"""Returns a list of watermarks after creating the widget."""
|
PyPDFForm/widgets/text.py
CHANGED
|
@@ -19,6 +19,6 @@ class TextWidget(Widget):
|
|
|
19
19
|
("max_length", "maxlen"),
|
|
20
20
|
]
|
|
21
21
|
COLOR_PARAMS = ["font_color", "bg_color", "border_color"]
|
|
22
|
-
ALLOWED_NON_ACRO_FORM_PARAMS = ["alignment"]
|
|
22
|
+
ALLOWED_NON_ACRO_FORM_PARAMS = ["alignment", "multiline"]
|
|
23
23
|
NONE_DEFAULTS = ["max_length"]
|
|
24
24
|
ACRO_FORM_FUNC = "textfield"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
PyPDFForm/__init__.py,sha256=
|
|
1
|
+
PyPDFForm/__init__.py,sha256=nGB4hFyhtEP1Yax2cCeP4M9Pj6qTiF2ENvyTcwe_MTA,179
|
|
2
2
|
PyPDFForm/adapter.py,sha256=WFP-r8FLeKa-D9mFO9AphOcuXgyeAI1Ak0d-YsqxsK4,861
|
|
3
3
|
PyPDFForm/constants.py,sha256=FMsdOvnYpchEfki3gf_Y2Wj1SThUxMzsPbOx12_S1GA,1738
|
|
4
4
|
PyPDFForm/coordinate.py,sha256=V_ZZQ1pXtVPAyfMJCX7fKoEimK7XwX6bU3VQ0nKOhQA,7314
|
|
5
5
|
PyPDFForm/filler.py,sha256=pgMA7EC8axKUganmbk7X1uDdsb4OQQFoiI85td3pOO4,7486
|
|
6
6
|
PyPDFForm/font.py,sha256=TbFLY4G72d7cQ3VG2g4HaYKROzQPQUmh6-8ynN6hzXY,5713
|
|
7
|
-
PyPDFForm/image.py,sha256=
|
|
8
|
-
PyPDFForm/patterns.py,sha256=
|
|
7
|
+
PyPDFForm/image.py,sha256=sjXPg9fjenNFj12a321xHX6JvuJs6PJRGLzpSNw5mVU,1180
|
|
8
|
+
PyPDFForm/patterns.py,sha256=9DFI-2cVZxzJKWmWBjK-dRSeAMNQr7ovHmw1YevrkiQ,5028
|
|
9
9
|
PyPDFForm/template.py,sha256=a9rDzhHHfnYFo8cDnHnRE9UriUykXvrsyFKVGq9DYd0,13166
|
|
10
10
|
PyPDFForm/utils.py,sha256=9omR-oT3OdZqioxpiGqA9_P0GSFC6mg4Y1xrLvWOzkk,4309
|
|
11
11
|
PyPDFForm/watermark.py,sha256=L4LfzjjyJ6TDq9ad2dbtQYheBOic1_oZ7smhFFekNog,4725
|
|
@@ -19,12 +19,12 @@ PyPDFForm/middleware/radio.py,sha256=ehaJoehEzZqxDVb5A6fJkYludeBmtV2Z5GZUPPfUWng
|
|
|
19
19
|
PyPDFForm/middleware/signature.py,sha256=m7tNvGZ7fQ0yuVKzSlLbNQ2IILo1GDnjzMDzMnYCKVM,1104
|
|
20
20
|
PyPDFForm/middleware/text.py,sha256=LNY_9Y2tq3uQEneKoL4vgrJtFTva0KSYzuuzDb5METM,1055
|
|
21
21
|
PyPDFForm/widgets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
-
PyPDFForm/widgets/base.py,sha256=
|
|
22
|
+
PyPDFForm/widgets/base.py,sha256=Re251Gxk22hvPE-jIlM3UMalcVGfP_nVJK3WAPYne78,3288
|
|
23
23
|
PyPDFForm/widgets/checkbox.py,sha256=MGB6NGI-XMBz4j2erykgYOCd1pswvthuQ6UFowQOd4o,503
|
|
24
24
|
PyPDFForm/widgets/dropdown.py,sha256=2_R5xcLUWAL0G4raVgWWtE7TJdiWJITay-Gtl8YI2QI,705
|
|
25
|
-
PyPDFForm/widgets/text.py,sha256=
|
|
26
|
-
PyPDFForm-1.4.
|
|
27
|
-
PyPDFForm-1.4.
|
|
28
|
-
PyPDFForm-1.4.
|
|
29
|
-
PyPDFForm-1.4.
|
|
30
|
-
PyPDFForm-1.4.
|
|
25
|
+
PyPDFForm/widgets/text.py,sha256=sCB8CQAjh30QOGr8FTIDSk3X6dXSHJztOz6YkKEBDss,691
|
|
26
|
+
PyPDFForm-1.4.33.dist-info/LICENSE,sha256=43awmYkI6opyTpg19me731iO1WfXZwViqb67oWtCsFY,1065
|
|
27
|
+
PyPDFForm-1.4.33.dist-info/METADATA,sha256=AfmRvobo1vnrBt5wic57TLhpDxoXlz3MOvNQws7vGKQ,4151
|
|
28
|
+
PyPDFForm-1.4.33.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
|
29
|
+
PyPDFForm-1.4.33.dist-info/top_level.txt,sha256=GQQKuWqPUjT9YZqwK95NlAQzxjwoQrsxQ8ureM8lWOY,10
|
|
30
|
+
PyPDFForm-1.4.33.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|