PyPDFForm 1.4.22__tar.gz → 1.4.23__tar.gz

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.

Files changed (46) hide show
  1. {pypdfform-1.4.22 → pypdfform-1.4.23}/PKG-INFO +1 -1
  2. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/__init__.py +1 -1
  3. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/filler.py +0 -1
  4. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/font.py +0 -1
  5. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/template.py +2 -1
  6. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/widgets/dropdown.py +6 -16
  7. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm.egg-info/PKG-INFO +1 -1
  8. {pypdfform-1.4.22 → pypdfform-1.4.23}/LICENSE +0 -0
  9. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/adapter.py +0 -0
  10. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/constants.py +0 -0
  11. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/coordinate.py +0 -0
  12. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/image.py +0 -0
  13. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/middleware/__init__.py +0 -0
  14. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/middleware/base.py +0 -0
  15. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/middleware/checkbox.py +0 -0
  16. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/middleware/dropdown.py +0 -0
  17. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/middleware/image.py +0 -0
  18. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/middleware/radio.py +0 -0
  19. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/middleware/signature.py +0 -0
  20. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/middleware/text.py +0 -0
  21. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/patterns.py +0 -0
  22. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/utils.py +0 -0
  23. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/watermark.py +0 -0
  24. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/widgets/__init__.py +0 -0
  25. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/widgets/base.py +0 -0
  26. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/widgets/checkbox.py +0 -0
  27. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/widgets/text.py +1 -1
  28. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm/wrapper.py +0 -0
  29. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm.egg-info/SOURCES.txt +0 -0
  30. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm.egg-info/dependency_links.txt +0 -0
  31. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm.egg-info/requires.txt +0 -0
  32. {pypdfform-1.4.22 → pypdfform-1.4.23}/PyPDFForm.egg-info/top_level.txt +0 -0
  33. {pypdfform-1.4.22 → pypdfform-1.4.23}/README.md +0 -0
  34. {pypdfform-1.4.22 → pypdfform-1.4.23}/setup.cfg +0 -0
  35. {pypdfform-1.4.22 → pypdfform-1.4.23}/setup.py +0 -0
  36. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_create_widget.py +0 -0
  37. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_dropdown.py +0 -0
  38. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_dropdown_simple.py +0 -0
  39. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_fill_max_length_text_field.py +0 -0
  40. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_fill_max_length_text_field_simple.py +0 -0
  41. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_functional.py +0 -0
  42. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_functional_simple.py +0 -0
  43. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_paragraph.py +0 -0
  44. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_paragraph_simple.py +0 -0
  45. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_preview.py +0 -0
  46. {pypdfform-1.4.22 → pypdfform-1.4.23}/tests/test_signature.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyPDFForm
3
- Version: 1.4.22
3
+ Version: 1.4.23
4
4
  Summary: The Python library for PDF forms.
5
5
  Home-page: https://github.com/chinapandaman/PyPDFForm
6
6
  Author: Jinge Li
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """Contains any object users might need."""
3
3
 
4
- __version__ = "1.4.22"
4
+ __version__ = "1.4.23"
5
5
 
6
6
  from .wrapper import FormWrapper, PdfWrapper, PyPDFForm
@@ -35,7 +35,6 @@ def fill(
35
35
  ) -> bytes:
36
36
  """Fills a PDF using watermarks."""
37
37
 
38
- # pylint: disable=too-many-branches
39
38
  texts_to_draw = {}
40
39
  images_to_draw = {}
41
40
  any_image_to_draw = False
@@ -36,7 +36,6 @@ def register_font(font_name: str, ttf_stream: bytes) -> bool:
36
36
  def auto_detect_font(widget: dict) -> str:
37
37
  """Returns the font of the text field if it is one of the standard fonts."""
38
38
 
39
- # pylint: disable=R0912
40
39
  result = DEFAULT_FONT
41
40
 
42
41
  text_appearance = None
@@ -1,6 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """Contains helpers for generic template related processing."""
3
3
 
4
+ from functools import lru_cache
4
5
  from sys import maxsize
5
6
  from typing import Dict, List, Tuple, Union
6
7
 
@@ -138,6 +139,7 @@ def update_text_field_attributes(
138
139
  )
139
140
 
140
141
 
142
+ @lru_cache()
141
143
  def get_widgets_by_page(pdf: bytes) -> Dict[int, List[dict]]:
142
144
  """Iterates through a PDF and returns all widgets found grouped by page."""
143
145
 
@@ -291,7 +293,6 @@ def get_character_x_paddings(widget: dict, widget_middleware: Text) -> List[floa
291
293
  def get_paragraph_lines(widget: dict, widget_middleware: Text) -> List[str]:
292
294
  """Splits the paragraph field's text to a list of lines."""
293
295
 
294
- # pylint: disable=R0912
295
296
  lines = []
296
297
  result = []
297
298
  value = widget_middleware.value or ""
@@ -1,26 +1,13 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """Contains dropdown widget to create."""
3
3
 
4
- from .base import Widget
4
+ from .text import TextWidget
5
5
 
6
6
 
7
- class DropdownWidget(Widget):
7
+ class DropdownWidget(TextWidget):
8
8
  """Dropdown widget to create."""
9
9
 
10
- # pylint: disable=R0801
11
-
12
- USER_PARAMS = [
13
- ("width", "width"),
14
- ("height", "height"),
15
- ("options", "options"),
16
- ("font", "fontName"),
17
- ("font_size", "fontSize"),
18
- ("font_color", "textColor"),
19
- ("bg_color", "fillColor"),
20
- ("border_color", "borderColor"),
21
- ("border_width", "borderWidth"),
22
- ]
23
- COLOR_PARAMS = ["font_color", "bg_color", "border_color"]
10
+ NONE_DEFAULTS = []
24
11
  ACRO_FORM_FUNC = "_textfield"
25
12
 
26
13
  def __init__(
@@ -33,6 +20,9 @@ class DropdownWidget(Widget):
33
20
  ) -> None:
34
21
  """Sets acro form parameters."""
35
22
 
23
+ self.USER_PARAMS = super().USER_PARAMS[:-1] + [
24
+ ("options", "options"),
25
+ ]
36
26
  super().__init__(name, page_number, x, y, **kwargs)
37
27
  self.acro_form_params["wkind"] = "choice"
38
28
  self.acro_form_params["value"] = self.acro_form_params["options"][0]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyPDFForm
3
- Version: 1.4.22
3
+ Version: 1.4.23
4
4
  Summary: The Python library for PDF forms.
5
5
  Home-page: https://github.com/chinapandaman/PyPDFForm
6
6
  Author: Jinge Li
File without changes
@@ -10,13 +10,13 @@ class TextWidget(Widget):
10
10
  USER_PARAMS = [
11
11
  ("width", "width"),
12
12
  ("height", "height"),
13
- ("max_length", "maxlen"),
14
13
  ("font", "fontName"),
15
14
  ("font_size", "fontSize"),
16
15
  ("font_color", "textColor"),
17
16
  ("bg_color", "fillColor"),
18
17
  ("border_color", "borderColor"),
19
18
  ("border_width", "borderWidth"),
19
+ ("max_length", "maxlen"),
20
20
  ]
21
21
  COLOR_PARAMS = ["font_color", "bg_color", "border_color"]
22
22
  NONE_DEFAULTS = ["max_length"]
File without changes
File without changes
File without changes