pdfdancer-client-python 0.2.8__py3-none-any.whl → 0.2.10__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 pdfdancer-client-python might be problematic. Click here for more details.

pdfdancer/__init__.py CHANGED
@@ -12,7 +12,7 @@ from .exceptions import (
12
12
  )
13
13
  from .models import (
14
14
  ObjectRef, Position, ObjectType, Font, Color, Image, BoundingRect, Paragraph, FormFieldRef,
15
- PositionMode, ShapeType, Point
15
+ PositionMode, ShapeType, Point, StandardFonts
16
16
  )
17
17
  from .paragraph_builder import ParagraphBuilder
18
18
 
@@ -32,6 +32,7 @@ __all__ = [
32
32
  "PositionMode",
33
33
  "ShapeType",
34
34
  "Point",
35
+ "StandardFonts",
35
36
  "PdfDancerException",
36
37
  "FontNotFoundException",
37
38
  "ValidationException",
pdfdancer/models.py CHANGED
@@ -8,6 +8,49 @@ from enum import Enum
8
8
  from typing import Optional, List, Any
9
9
 
10
10
 
11
+ class StandardFonts(Enum):
12
+ """
13
+ The 14 standard PDF fonts that are guaranteed to be available in all PDF readers.
14
+ These fonts do not need to be embedded in the PDF document.
15
+
16
+ Serif fonts (Times family):
17
+ - TIMES_ROMAN: Standard Times Roman font
18
+ - TIMES_BOLD: Bold version of Times Roman
19
+ - TIMES_ITALIC: Italic version of Times Roman
20
+ - TIMES_BOLD_ITALIC: Bold and italic version of Times Roman
21
+
22
+ Sans-serif fonts (Helvetica family):
23
+ - HELVETICA: Standard Helvetica font
24
+ - HELVETICA_BOLD: Bold version of Helvetica
25
+ - HELVETICA_OBLIQUE: Oblique (italic) version of Helvetica
26
+ - HELVETICA_BOLD_OBLIQUE: Bold and oblique version of Helvetica
27
+
28
+ Monospace fonts (Courier family):
29
+ - COURIER: Standard Courier font
30
+ - COURIER_BOLD: Bold version of Courier
31
+ - COURIER_OBLIQUE: Oblique (italic) version of Courier
32
+ - COURIER_BOLD_OBLIQUE: Bold and oblique version of Courier
33
+
34
+ Symbol and decorative fonts:
35
+ - SYMBOL: Symbol font for mathematical and special characters
36
+ - ZAPF_DINGBATS: Zapf Dingbats font for decorative symbols
37
+ """
38
+ TIMES_ROMAN = "Times-Roman"
39
+ TIMES_BOLD = "Times-Bold"
40
+ TIMES_ITALIC = "Times-Italic"
41
+ TIMES_BOLD_ITALIC = "Times-BoldItalic"
42
+ HELVETICA = "Helvetica"
43
+ HELVETICA_BOLD = "Helvetica-Bold"
44
+ HELVETICA_OBLIQUE = "Helvetica-Oblique"
45
+ HELVETICA_BOLD_OBLIQUE = "Helvetica-BoldOblique"
46
+ COURIER = "Courier"
47
+ COURIER_BOLD = "Courier-Bold"
48
+ COURIER_OBLIQUE = "Courier-Oblique"
49
+ COURIER_BOLD_OBLIQUE = "Courier-BoldOblique"
50
+ SYMBOL = "Symbol"
51
+ ZAPF_DINGBATS = "ZapfDingbats"
52
+
53
+
11
54
  class ObjectType(Enum):
12
55
  """Object type enumeration matching the Java ObjectType."""
13
56
  FORM_FIELD = "FORM_FIELD"
@@ -268,3 +268,14 @@ class ParagraphBuilder:
268
268
 
269
269
  def add(self):
270
270
  self._client._add_paragraph(self.build())
271
+
272
+
273
+ class ParagraphPageBuilder(ParagraphBuilder):
274
+
275
+ def __init__(self, client: 'PDFDancer', page_index: int):
276
+ super().__init__(client)
277
+ self._page_index: Optional[int] = page_index
278
+
279
+ # noinspection PyMethodOverriding
280
+ def at(self, x: float, y: float) -> 'ParagraphBuilder':
281
+ return super().at(self._page_index, x, y)
pdfdancer/pdfdancer_v1.py CHANGED
@@ -26,6 +26,7 @@ from .models import (
26
26
  FindRequest, DeleteRequest, MoveRequest, AddRequest, ModifyRequest, ModifyTextRequest, ChangeFormFieldRequest,
27
27
  ShapeType, PositionMode
28
28
  )
29
+ from .paragraph_builder import ParagraphPageBuilder
29
30
  from .types import PathObject, ParagraphObject, TextLineObject, ImageObject, FormObject, FormFieldObject
30
31
 
31
32
 
@@ -114,6 +115,9 @@ class PageClient:
114
115
  def _ref(self):
115
116
  return ObjectRef(internal_id=self.internal_id, position=self.position, type=self.object_type)
116
117
 
118
+ def new_paragraph(self):
119
+ return ParagraphPageBuilder(self.root, self.page_index)
120
+
117
121
 
118
122
  class PDFDancer:
119
123
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdfdancer-client-python
3
- Version: 0.2.8
3
+ Version: 0.2.10
4
4
  Summary: Python client for PDFDancer API
5
5
  Author-email: "The Famous Cat Ltd." <hi@thefamouscat.com>
6
6
  License: MIT
@@ -0,0 +1,11 @@
1
+ pdfdancer/__init__.py,sha256=4sMkf0d6GvQ-6L1cPzEDyWuSt0b-ek8ZlyvashOXqZ4,1040
2
+ pdfdancer/exceptions.py,sha256=Y5zwNVZprsv2hvKX304cXWobJt11nrEhCzLklu2wiO8,1567
3
+ pdfdancer/image_builder.py,sha256=Omxc2LcieJ1MbvWBXR5_sfia--eAucTUe0KWgr22HYo,842
4
+ pdfdancer/models.py,sha256=MmiW1xEU9WwpZV6cHNotNcbm-GoxLfeoRt_CurNGnjc,17105
5
+ pdfdancer/paragraph_builder.py,sha256=mjV36-XOqcYATfIjSOy7_SBO0EKXjsAtMqYL8IaowGU,9218
6
+ pdfdancer/pdfdancer_v1.py,sha256=fUfXdc-WCwYHcoK779nxwgV171TR7yGUgv2-Xl9fM8A,36104
7
+ pdfdancer/types.py,sha256=TtXbOqa8febqTUmYF97tq-y6i-jNuO6UHvmAmSJHz20,7466
8
+ pdfdancer_client_python-0.2.10.dist-info/METADATA,sha256=zzVq_3CxC0YG5Wb5vNpSY4LqoC-XXdLNVyLsJPDDwFA,6770
9
+ pdfdancer_client_python-0.2.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ pdfdancer_client_python-0.2.10.dist-info/top_level.txt,sha256=ICwSVRpcCKrdBF9QlaX9Y0e_N3Nk1p7QVxadGOnbxeY,10
11
+ pdfdancer_client_python-0.2.10.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- pdfdancer/__init__.py,sha256=5HVIUIEESA_GQHKJhItdperrx079oFZM028ciSt2Z9o,1004
2
- pdfdancer/exceptions.py,sha256=Y5zwNVZprsv2hvKX304cXWobJt11nrEhCzLklu2wiO8,1567
3
- pdfdancer/image_builder.py,sha256=Omxc2LcieJ1MbvWBXR5_sfia--eAucTUe0KWgr22HYo,842
4
- pdfdancer/models.py,sha256=SmkKScr47uVs6FCWUAVIg6rucYrYHvbIxZngyA50XyI,15498
5
- pdfdancer/paragraph_builder.py,sha256=bAfwX9U2YT1UGX9EKkPnGYvGK3SQP3X1ocxlgyLE_rU,8872
6
- pdfdancer/pdfdancer_v1.py,sha256=f9RjlbMRHEFcf2syYVZbtAnv-6Ny-VqMN0Wp_h7to4s,35958
7
- pdfdancer/types.py,sha256=TtXbOqa8febqTUmYF97tq-y6i-jNuO6UHvmAmSJHz20,7466
8
- pdfdancer_client_python-0.2.8.dist-info/METADATA,sha256=iw817FadM5Gd8Qmbo4dawXKLRbJPLvJZcuaIjyOiLcU,6769
9
- pdfdancer_client_python-0.2.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
- pdfdancer_client_python-0.2.8.dist-info/top_level.txt,sha256=ICwSVRpcCKrdBF9QlaX9Y0e_N3Nk1p7QVxadGOnbxeY,10
11
- pdfdancer_client_python-0.2.8.dist-info/RECORD,,