PyPDFForm 1.4.28__py3-none-any.whl → 1.4.30__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/constants.py +1 -2
- PyPDFForm/patterns.py +3 -3
- PyPDFForm/wrapper.py +5 -1
- {PyPDFForm-1.4.28.dist-info → PyPDFForm-1.4.30.dist-info}/METADATA +2 -8
- {PyPDFForm-1.4.28.dist-info → PyPDFForm-1.4.30.dist-info}/RECORD +9 -9
- {PyPDFForm-1.4.28.dist-info → PyPDFForm-1.4.30.dist-info}/WHEEL +1 -1
- {PyPDFForm-1.4.28.dist-info → PyPDFForm-1.4.30.dist-info}/LICENSE +0 -0
- {PyPDFForm-1.4.28.dist-info → PyPDFForm-1.4.30.dist-info}/top_level.txt +0 -0
PyPDFForm/__init__.py
CHANGED
PyPDFForm/constants.py
CHANGED
|
@@ -32,8 +32,6 @@ A = "/A"
|
|
|
32
32
|
JS = "/JS"
|
|
33
33
|
T = "/T"
|
|
34
34
|
Rect = "/Rect"
|
|
35
|
-
Subtype = "/Subtype"
|
|
36
|
-
Widget = "/Widget"
|
|
37
35
|
FT = "/FT"
|
|
38
36
|
Parent = "/Parent"
|
|
39
37
|
Ff = "/Ff"
|
|
@@ -43,6 +41,7 @@ AP = "/AP"
|
|
|
43
41
|
N = "/N"
|
|
44
42
|
Sig = "/Sig"
|
|
45
43
|
DA = "/DA"
|
|
44
|
+
DV = "/DV"
|
|
46
45
|
Btn = "/Btn"
|
|
47
46
|
MaxLen = "/MaxLen"
|
|
48
47
|
Q = "/Q"
|
PyPDFForm/patterns.py
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
from pypdf.generic import (DictionaryObject, NameObject, NumberObject,
|
|
5
5
|
TextStringObject)
|
|
6
6
|
|
|
7
|
-
from .constants import (AP, AS, CA, DA, FT, IMAGE_FIELD_IDENTIFIER, JS, MK,
|
|
7
|
+
from .constants import (AP, AS, CA, DA, DV, FT, IMAGE_FIELD_IDENTIFIER, JS, MK,
|
|
8
8
|
READ_ONLY, A, Btn, Ch, Ff, N, Off, Opt, Parent, Q, Sig,
|
|
9
|
-
|
|
9
|
+
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
|
|
@@ -49,7 +49,7 @@ WIDGET_TYPE_PATTERNS = [
|
|
|
49
49
|
(
|
|
50
50
|
(
|
|
51
51
|
{Parent: {FT: Btn}},
|
|
52
|
-
{Parent: {
|
|
52
|
+
{Parent: {DV: (Yes, Off)}},
|
|
53
53
|
{AS: (Yes, Off)},
|
|
54
54
|
),
|
|
55
55
|
Checkbox,
|
PyPDFForm/wrapper.py
CHANGED
|
@@ -8,7 +8,8 @@ from typing import BinaryIO, Dict, List, Tuple, Union
|
|
|
8
8
|
|
|
9
9
|
from .adapter import fp_or_f_obj_or_stream_to_stream
|
|
10
10
|
from .constants import (DEFAULT_FONT, DEFAULT_FONT_COLOR, DEFAULT_FONT_SIZE,
|
|
11
|
-
VERSION_IDENTIFIER_PREFIX,
|
|
11
|
+
NEW_LINE_SYMBOL, VERSION_IDENTIFIER_PREFIX,
|
|
12
|
+
VERSION_IDENTIFIERS)
|
|
12
13
|
from .coordinate import generate_coordinate_grid
|
|
13
14
|
from .filler import fill, simple_fill
|
|
14
15
|
from .font import register_font
|
|
@@ -244,6 +245,9 @@ class PdfWrapper(FormWrapper):
|
|
|
244
245
|
new_widget.font_size = kwargs.get("font_size", DEFAULT_FONT_SIZE)
|
|
245
246
|
new_widget.font_color = kwargs.get("font_color", DEFAULT_FONT_COLOR)
|
|
246
247
|
|
|
248
|
+
if NEW_LINE_SYMBOL in text:
|
|
249
|
+
new_widget.text_lines = text.split(NEW_LINE_SYMBOL)
|
|
250
|
+
|
|
247
251
|
watermarks = create_watermarks_and_draw(
|
|
248
252
|
self.stream,
|
|
249
253
|
page_number,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyPDFForm
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.30
|
|
4
4
|
Summary: The Python library for PDF forms.
|
|
5
5
|
Home-page: https://github.com/chinapandaman/PyPDFForm
|
|
6
6
|
Author: Jinge Li
|
|
@@ -83,12 +83,6 @@ and it should look like [this](https://github.com/chinapandaman/PyPDFForm/raw/ma
|
|
|
83
83
|
|
|
84
84
|
The official documentation can be found on [the GitHub page](https://chinapandaman.github.io/PyPDFForm/) of this repository.
|
|
85
85
|
|
|
86
|
-
##
|
|
86
|
+
## Other Resources
|
|
87
87
|
|
|
88
88
|
[Chicago Python User Group - Dec 14, 2023](https://youtu.be/8t1RdAKwr9w?si=TLgumBNXv9H8szSn)
|
|
89
|
-
|
|
90
|
-
## How to Contribute
|
|
91
|
-
|
|
92
|
-
It is difficult to make sure that the library supports all the PDF form creating tools out
|
|
93
|
-
there. So if you run into a case where the library does not work for certain PDF forms created by certain tools, feel free to open an issue with the problematic PDF form attached. I will seek
|
|
94
|
-
to make the library support the attached PDF form as well as the tool used to create it.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
PyPDFForm/__init__.py,sha256=
|
|
1
|
+
PyPDFForm/__init__.py,sha256=qhBV2ZeK4rXK6ALggenAeEKbQNeDPTqkc48DVVtCFWg,138
|
|
2
2
|
PyPDFForm/adapter.py,sha256=OgAIwcmukpBqHFBLymd3I7wA7wIdipRqgURZA2Y0Hgo,885
|
|
3
|
-
PyPDFForm/constants.py,sha256=
|
|
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=DCaKN6WIfNeMpP6ud17q1FOVRQXqrdevLycIQ9kItXQ,5711
|
|
7
7
|
PyPDFForm/image.py,sha256=0GV8PFgY5oLJFHmhPD1fG-_5SBEO7jVLLtxCc_Uodfo,1143
|
|
8
|
-
PyPDFForm/patterns.py,sha256=
|
|
8
|
+
PyPDFForm/patterns.py,sha256=p33mDZKxQN2h8GgVnZGXNolWPzofky1llIpstjnL3eI,4318
|
|
9
9
|
PyPDFForm/template.py,sha256=u3QxYdsT8HhoUBlhmChYaTJeFWI-SSrhICtUYsTTrow,13141
|
|
10
10
|
PyPDFForm/utils.py,sha256=gDeRDszZ5Q59RjZjJYnikS2pQ_hc78osQH2Oy1TuLsY,4269
|
|
11
11
|
PyPDFForm/watermark.py,sha256=clYdRqCuWEE25IL-BUHnSo4HgLkHPSOl7FUJLhbAfGg,4755
|
|
12
|
-
PyPDFForm/wrapper.py,sha256=
|
|
12
|
+
PyPDFForm/wrapper.py,sha256=nwmaBkcnd0wt53s9SHHWFCvSJX4J2f7MU3ktt3105WU,9496
|
|
13
13
|
PyPDFForm/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
PyPDFForm/middleware/base.py,sha256=TmoO8XpjFa5NerAumrAGm_kUt2eFP3DyyF-Vx0uXloM,724
|
|
15
15
|
PyPDFForm/middleware/checkbox.py,sha256=Z92awlKjceMd_ryb9Fhrtyd4fLkU84Ii6fSum60rHcA,1305
|
|
@@ -23,8 +23,8 @@ PyPDFForm/widgets/base.py,sha256=Stq-oQt-cfwQ6nilQ4NqpO5udFSKDNb1mAwryrWggZA,207
|
|
|
23
23
|
PyPDFForm/widgets/checkbox.py,sha256=MGB6NGI-XMBz4j2erykgYOCd1pswvthuQ6UFowQOd4o,503
|
|
24
24
|
PyPDFForm/widgets/dropdown.py,sha256=2_R5xcLUWAL0G4raVgWWtE7TJdiWJITay-Gtl8YI2QI,705
|
|
25
25
|
PyPDFForm/widgets/text.py,sha256=x8EglZLYoI9osN9wORLRYoR7lebrpj-wx38QiRH7H1A,629
|
|
26
|
-
PyPDFForm-1.4.
|
|
27
|
-
PyPDFForm-1.4.
|
|
28
|
-
PyPDFForm-1.4.
|
|
29
|
-
PyPDFForm-1.4.
|
|
30
|
-
PyPDFForm-1.4.
|
|
26
|
+
PyPDFForm-1.4.30.dist-info/LICENSE,sha256=43awmYkI6opyTpg19me731iO1WfXZwViqb67oWtCsFY,1065
|
|
27
|
+
PyPDFForm-1.4.30.dist-info/METADATA,sha256=l5vS_GMEnKq-mC_2MuE0fsORqiF9QrWUKOfFuc1t-P0,4151
|
|
28
|
+
PyPDFForm-1.4.30.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
|
29
|
+
PyPDFForm-1.4.30.dist-info/top_level.txt,sha256=GQQKuWqPUjT9YZqwK95NlAQzxjwoQrsxQ8ureM8lWOY,10
|
|
30
|
+
PyPDFForm-1.4.30.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|