PyPDFForm 1.5.3__py3-none-any.whl → 1.5.4__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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """Contains any object users might need."""
3
3
 
4
- __version__ = "1.5.3"
4
+ __version__ = "1.5.4"
5
5
 
6
6
  from .wrapper import FormWrapper, PdfWrapper
7
7
 
@@ -1,21 +1,10 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """Contains image field middleware."""
3
3
 
4
- from typing import BinaryIO, Union
5
-
6
4
  from .signature import Signature
7
5
 
8
6
 
9
7
  class Image(Signature):
10
8
  """A class to represent an image field widget."""
11
9
 
12
- def __init__(
13
- self,
14
- name: str,
15
- value: Union[bytes, str, BinaryIO] = None,
16
- ) -> None:
17
- """Constructs all attributes for the image field."""
18
-
19
- super().__init__(name, value)
20
-
21
- self.preserve_aspect_ratio = False
10
+ preserve_aspect_ratio = False
@@ -7,16 +7,7 @@ from .checkbox import Checkbox
7
7
  class Radio(Checkbox):
8
8
  """A class to represent a radiobutton widget."""
9
9
 
10
- def __init__(
11
- self,
12
- name: str,
13
- value: int = None,
14
- ) -> None:
15
- """Constructs all attributes for the radiobutton."""
16
-
17
- super().__init__(name, value)
18
-
19
- self.number_of_options = 0
10
+ number_of_options = 0
20
11
 
21
12
  @property
22
13
  def schema_definition(self) -> dict:
@@ -11,6 +11,8 @@ from .base import Widget
11
11
  class Signature(Widget):
12
12
  """A class to represent a signature field widget."""
13
13
 
14
+ preserve_aspect_ratio = True
15
+
14
16
  def __init__(
15
17
  self,
16
18
  name: str,
@@ -20,8 +22,6 @@ class Signature(Widget):
20
22
 
21
23
  super().__init__(name, value)
22
24
 
23
- self.preserve_aspect_ratio = True
24
-
25
25
  @property
26
26
  def schema_definition(self) -> dict:
27
27
  """Json schema definition of the signature field."""
PyPDFForm/wrapper.py CHANGED
@@ -166,10 +166,13 @@ class PdfWrapper(FormWrapper):
166
166
  if not other.stream:
167
167
  return self
168
168
 
169
- new_obj = self.__class__()
170
- new_obj.stream = merge_two_pdfs(self.stream, other.stream)
169
+ for k in self.widgets:
170
+ if k in other.widgets:
171
+ other.update_widget_key(k, f"{k}-{id(other)}", defer=True)
171
172
 
172
- return new_obj
173
+ other.commit_widget_key_updates()
174
+
175
+ return self.__class__(merge_two_pdfs(self.stream, other.stream))
173
176
 
174
177
  @property
175
178
  def preview(self) -> bytes:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PyPDFForm
3
- Version: 1.5.3
3
+ Version: 1.5.4
4
4
  Summary: The Python library for PDF forms.
5
5
  Home-page: https://github.com/chinapandaman/PyPDFForm
6
6
  Author: Jinge Li
@@ -1,4 +1,4 @@
1
- PyPDFForm/__init__.py,sha256=GbSU_vP9pxo3lFMOfxaLUhhW6V5_26Xh7t3B3b6rEK0,178
1
+ PyPDFForm/__init__.py,sha256=7kE_CzxALB37_zXnvY-D6uR_PPuFMpPVucShuQjQOCk,178
2
2
  PyPDFForm/adapter.py,sha256=qt0lqd7zRzaMHD2As47oiIhungO3AyWbAkxx1ZAZi9A,862
3
3
  PyPDFForm/constants.py,sha256=xj9CSq7PlCpAowKAlK0o8YPgPkBkJjRDToI8aiqC_c0,1749
4
4
  PyPDFForm/coordinate.py,sha256=uZGGFiTUIrD9VX-bzgUpKlFAzK7VJppW1corGXvT-pY,7712
@@ -9,22 +9,22 @@ PyPDFForm/patterns.py,sha256=Z548TjpQpaVepctvlRYe0-2i7Aws96fo-ncG82CUX14,5423
9
9
  PyPDFForm/template.py,sha256=LlnZTNF5UPLkiGqnSgHNcVr_Af6vJyg6vBf7jVD5wAM,15470
10
10
  PyPDFForm/utils.py,sha256=9omR-oT3OdZqioxpiGqA9_P0GSFC6mg4Y1xrLvWOzkk,4309
11
11
  PyPDFForm/watermark.py,sha256=L4LfzjjyJ6TDq9ad2dbtQYheBOic1_oZ7smhFFekNog,4725
12
- PyPDFForm/wrapper.py,sha256=dxcFnkMv7zwT75BWZxgbrpl-Ty1dB98gjiP6xp9ihAU,11565
12
+ PyPDFForm/wrapper.py,sha256=tbmJIwvu4anaol7wQpmWL908CC04d_IAVRfE39K3y6k,11697
13
13
  PyPDFForm/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  PyPDFForm/middleware/base.py,sha256=Sjo8O9RrdBu73r4BCMPuLXnrl1hzjb1dlTOPeIgrhOU,1150
15
15
  PyPDFForm/middleware/checkbox.py,sha256=0EWFECXYdz9SNxgGe1QCcRrdxLVUIJpzRYwKfGRA9e4,1346
16
16
  PyPDFForm/middleware/dropdown.py,sha256=_RXs9o3vWH_a402zhTOYE_mcWbtFfVU7bReYcEFAIyk,793
17
- PyPDFForm/middleware/image.py,sha256=zR31u3dPVwhxECMGb6KaHFQrTKtbF5djBDmoyPl3WK0,475
18
- PyPDFForm/middleware/radio.py,sha256=uffpK15U1gUn7mkyOcMwZByZo-I2cMWWsW3sBb1WeYk,801
19
- PyPDFForm/middleware/signature.py,sha256=cDsJX7q-KSZi9Sd90Gx1c9cMyTqZBExZ-enWJMjFZNw,1147
17
+ PyPDFForm/middleware/image.py,sha256=tQrLKZUKOz90jKxuUQpTP4Awuvtf0I92LeANH0k6mzQ,212
18
+ PyPDFForm/middleware/radio.py,sha256=KfwOtlnMk5B2y8KbqD-ONN5AbkHa4TF5NzdcZlbNyDk,598
19
+ PyPDFForm/middleware/signature.py,sha256=1ZOkBKectZ7kptJMQ-EuOA_xI7j8dlwseo2p2Z0FS2o,1138
20
20
  PyPDFForm/middleware/text.py,sha256=7HFHy_lfBFfYbSUzgVKovSoShbNP6L7tiILIw-9_kpo,1549
21
21
  PyPDFForm/widgets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  PyPDFForm/widgets/base.py,sha256=nb6HEfRdWSjZc_Th1XI62PIlgREn_JiApGC-epb6jAg,3348
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=sCB8CQAjh30QOGr8FTIDSk3X6dXSHJztOz6YkKEBDss,691
26
- PyPDFForm-1.5.3.dist-info/LICENSE,sha256=43awmYkI6opyTpg19me731iO1WfXZwViqb67oWtCsFY,1065
27
- PyPDFForm-1.5.3.dist-info/METADATA,sha256=GwIvR6NToB1-7l6XqlvxGct0x0gOhOrwjLL7Jg9ZAgg,4376
28
- PyPDFForm-1.5.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
29
- PyPDFForm-1.5.3.dist-info/top_level.txt,sha256=GQQKuWqPUjT9YZqwK95NlAQzxjwoQrsxQ8ureM8lWOY,10
30
- PyPDFForm-1.5.3.dist-info/RECORD,,
26
+ pypdfform-1.5.4.dist-info/LICENSE,sha256=43awmYkI6opyTpg19me731iO1WfXZwViqb67oWtCsFY,1065
27
+ pypdfform-1.5.4.dist-info/METADATA,sha256=4FkB1rXuP42Wz06oxGdgDYtGOweJ8ddfFEUz74tyQZE,4376
28
+ pypdfform-1.5.4.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
29
+ pypdfform-1.5.4.dist-info/top_level.txt,sha256=GQQKuWqPUjT9YZqwK95NlAQzxjwoQrsxQ8ureM8lWOY,10
30
+ pypdfform-1.5.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5