pdfdancer-client-python 0.2.7__py3-none-any.whl → 0.2.9__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/paragraph_builder.py +11 -0
- pdfdancer/pdfdancer_v1.py +6 -2
- {pdfdancer_client_python-0.2.7.dist-info → pdfdancer_client_python-0.2.9.dist-info}/METADATA +1 -1
- {pdfdancer_client_python-0.2.7.dist-info → pdfdancer_client_python-0.2.9.dist-info}/RECORD +6 -6
- {pdfdancer_client_python-0.2.7.dist-info → pdfdancer_client_python-0.2.9.dist-info}/WHEEL +0 -0
- {pdfdancer_client_python-0.2.7.dist-info → pdfdancer_client_python-0.2.9.dist-info}/top_level.txt +0 -0
pdfdancer/paragraph_builder.py
CHANGED
|
@@ -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
|
"""
|
|
@@ -779,7 +783,7 @@ class PDFDancer:
|
|
|
779
783
|
|
|
780
784
|
# Document Operations
|
|
781
785
|
|
|
782
|
-
def
|
|
786
|
+
def get_bytes(self) -> bytes:
|
|
783
787
|
"""
|
|
784
788
|
Downloads the current state of the PDF document with all modifications applied.
|
|
785
789
|
|
|
@@ -804,7 +808,7 @@ class PDFDancer:
|
|
|
804
808
|
raise ValidationException("File path cannot be null or empty")
|
|
805
809
|
|
|
806
810
|
try:
|
|
807
|
-
pdf_data = self.
|
|
811
|
+
pdf_data = self.get_bytes()
|
|
808
812
|
output_path = Path(file_path)
|
|
809
813
|
|
|
810
814
|
# Create parent directories if they don't exist
|
|
@@ -2,10 +2,10 @@ pdfdancer/__init__.py,sha256=5HVIUIEESA_GQHKJhItdperrx079oFZM028ciSt2Z9o,1004
|
|
|
2
2
|
pdfdancer/exceptions.py,sha256=Y5zwNVZprsv2hvKX304cXWobJt11nrEhCzLklu2wiO8,1567
|
|
3
3
|
pdfdancer/image_builder.py,sha256=Omxc2LcieJ1MbvWBXR5_sfia--eAucTUe0KWgr22HYo,842
|
|
4
4
|
pdfdancer/models.py,sha256=SmkKScr47uVs6FCWUAVIg6rucYrYHvbIxZngyA50XyI,15498
|
|
5
|
-
pdfdancer/paragraph_builder.py,sha256=
|
|
6
|
-
pdfdancer/pdfdancer_v1.py,sha256=
|
|
5
|
+
pdfdancer/paragraph_builder.py,sha256=mjV36-XOqcYATfIjSOy7_SBO0EKXjsAtMqYL8IaowGU,9218
|
|
6
|
+
pdfdancer/pdfdancer_v1.py,sha256=fUfXdc-WCwYHcoK779nxwgV171TR7yGUgv2-Xl9fM8A,36104
|
|
7
7
|
pdfdancer/types.py,sha256=TtXbOqa8febqTUmYF97tq-y6i-jNuO6UHvmAmSJHz20,7466
|
|
8
|
-
pdfdancer_client_python-0.2.
|
|
9
|
-
pdfdancer_client_python-0.2.
|
|
10
|
-
pdfdancer_client_python-0.2.
|
|
11
|
-
pdfdancer_client_python-0.2.
|
|
8
|
+
pdfdancer_client_python-0.2.9.dist-info/METADATA,sha256=tIdadB6rM5aM-joMlgo3IMJWSEx5tkylcW9LSAvfpmM,6769
|
|
9
|
+
pdfdancer_client_python-0.2.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
+
pdfdancer_client_python-0.2.9.dist-info/top_level.txt,sha256=ICwSVRpcCKrdBF9QlaX9Y0e_N3Nk1p7QVxadGOnbxeY,10
|
|
11
|
+
pdfdancer_client_python-0.2.9.dist-info/RECORD,,
|
|
File without changes
|
{pdfdancer_client_python-0.2.7.dist-info → pdfdancer_client_python-0.2.9.dist-info}/top_level.txt
RENAMED
|
File without changes
|