PyPDFForm 1.4.33__tar.gz → 1.4.35__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.
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PKG-INFO +1 -1
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/__init__.py +1 -1
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/middleware/dropdown.py +1 -1
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/middleware/radio.py +1 -1
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/middleware/text.py +3 -1
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/widgets/base.py +1 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm.egg-info/PKG-INFO +1 -1
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_create_widget.py +24 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_dropdown.py +4 -2
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_functional.py +19 -17
- {pypdfform-1.4.33 → pypdfform-1.4.35}/LICENSE +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/adapter.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/constants.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/coordinate.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/filler.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/font.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/image.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/middleware/__init__.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/middleware/base.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/middleware/checkbox.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/middleware/image.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/middleware/signature.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/patterns.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/template.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/utils.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/watermark.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/widgets/__init__.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/widgets/checkbox.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/widgets/dropdown.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/widgets/text.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm/wrapper.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm.egg-info/SOURCES.txt +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm.egg-info/dependency_links.txt +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm.egg-info/requires.txt +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/PyPDFForm.egg-info/top_level.txt +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/README.md +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/setup.cfg +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/setup.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_adobe_mode.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_dropdown_simple.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_fill_max_length_text_field.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_fill_max_length_text_field_simple.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_functional_simple.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_paragraph.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_paragraph_simple.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_preview.py +0 -0
- {pypdfform-1.4.33 → pypdfform-1.4.35}/tests/test_signature.py +0 -0
|
@@ -198,6 +198,30 @@ def test_create_text_default(template_stream, pdf_samples, request):
|
|
|
198
198
|
assert obj.stream == expected
|
|
199
199
|
|
|
200
200
|
|
|
201
|
+
def test_create_text_alpha_bg_color(template_stream, pdf_samples, request):
|
|
202
|
+
expected_path = os.path.join(
|
|
203
|
+
pdf_samples, "widget", "create_text_alpha_bg_color.pdf"
|
|
204
|
+
)
|
|
205
|
+
with open(expected_path, "rb+") as f:
|
|
206
|
+
obj = PdfWrapper(template_stream).create_widget(
|
|
207
|
+
"text",
|
|
208
|
+
"foo",
|
|
209
|
+
1,
|
|
210
|
+
100,
|
|
211
|
+
100,
|
|
212
|
+
bg_color=(0, 0, 1, 0),
|
|
213
|
+
)
|
|
214
|
+
assert obj.schema["properties"]["foo"]["type"] == "string"
|
|
215
|
+
|
|
216
|
+
request.config.results["expected_path"] = expected_path
|
|
217
|
+
request.config.results["stream"] = obj.read()
|
|
218
|
+
|
|
219
|
+
expected = f.read()
|
|
220
|
+
|
|
221
|
+
assert len(obj.stream) == len(expected)
|
|
222
|
+
assert obj.stream == expected
|
|
223
|
+
|
|
224
|
+
|
|
201
225
|
def test_create_text_align_center(template_stream, pdf_samples, request):
|
|
202
226
|
expected_path = os.path.join(pdf_samples, "widget", "create_text_align_center.pdf")
|
|
203
227
|
with open(expected_path, "rb+") as f:
|
|
@@ -6,12 +6,14 @@ from PyPDFForm import PdfWrapper
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def test_schema(sample_template_with_dropdown):
|
|
9
|
-
|
|
9
|
+
obj = PdfWrapper(sample_template_with_dropdown)
|
|
10
10
|
|
|
11
|
-
for key, value in schema["properties"].items():
|
|
11
|
+
for key, value in obj.schema["properties"].items():
|
|
12
12
|
if key == "dropdown_1":
|
|
13
13
|
assert value["maximum"] == 3
|
|
14
14
|
|
|
15
|
+
assert obj.sample_data["dropdown_1"] == 3
|
|
16
|
+
|
|
15
17
|
|
|
16
18
|
def test_dropdown_not_specified(sample_template_with_dropdown):
|
|
17
19
|
assert (
|
|
@@ -258,7 +258,7 @@ def test_draw_image_on_one_page(template_stream, image_samples, pdf_samples, req
|
|
|
258
258
|
|
|
259
259
|
expected = f.read()
|
|
260
260
|
|
|
261
|
-
if os.name
|
|
261
|
+
if os.name != "nt":
|
|
262
262
|
request.config.results["expected_path"] = expected_path
|
|
263
263
|
request.config.results["stream"] = obj.read()
|
|
264
264
|
assert len(obj.stream) == len(expected)
|
|
@@ -281,7 +281,7 @@ def test_draw_png_image_on_one_page(
|
|
|
281
281
|
|
|
282
282
|
expected = f.read()
|
|
283
283
|
|
|
284
|
-
if os.name
|
|
284
|
+
if os.name != "nt":
|
|
285
285
|
request.config.results["expected_path"] = expected_path
|
|
286
286
|
request.config.results["stream"] = obj.read()
|
|
287
287
|
assert len(obj.stream) == len(expected)
|
|
@@ -304,7 +304,7 @@ def test_draw_transparent_png_image_on_one_page(
|
|
|
304
304
|
|
|
305
305
|
expected = f.read()
|
|
306
306
|
|
|
307
|
-
if os.name
|
|
307
|
+
if os.name != "nt":
|
|
308
308
|
request.config.results["expected_path"] = expected_path
|
|
309
309
|
request.config.results["stream"] = obj.read()
|
|
310
310
|
assert len(obj.stream) == len(expected)
|
|
@@ -406,6 +406,17 @@ def test_sample_data(sejda_template_complex):
|
|
|
406
406
|
pass
|
|
407
407
|
|
|
408
408
|
|
|
409
|
+
def test_sample_data_max_boundary(sample_template_with_comb_text_field):
|
|
410
|
+
obj = PdfWrapper(sample_template_with_comb_text_field)
|
|
411
|
+
try:
|
|
412
|
+
validate(instance=obj.sample_data, schema=obj.schema)
|
|
413
|
+
except ValidationError:
|
|
414
|
+
raise AssertionError from ValidationError
|
|
415
|
+
|
|
416
|
+
assert obj.sample_data["LastName"] == "LastNam"
|
|
417
|
+
assert obj.sample_data["Gender"] == 1
|
|
418
|
+
|
|
419
|
+
|
|
409
420
|
def test_fill_right_aligned(
|
|
410
421
|
sample_template_with_right_aligned_text_field, pdf_samples, request
|
|
411
422
|
):
|
|
@@ -499,24 +510,15 @@ def test_fill_complex_fonts(sample_template_with_complex_fonts, pdf_samples, req
|
|
|
499
510
|
assert obj.stream == expected
|
|
500
511
|
|
|
501
512
|
|
|
502
|
-
def test_pages(template_stream, pdf_samples):
|
|
513
|
+
def test_pages(template_stream, pdf_samples, request):
|
|
514
|
+
expected_path = os.path.join(pdf_samples, "pages", "sample_template_page_1.pdf")
|
|
503
515
|
obj = PdfWrapper(template_stream)
|
|
504
516
|
|
|
505
|
-
with open(
|
|
506
|
-
|
|
507
|
-
|
|
517
|
+
with open(expected_path, "rb+") as f:
|
|
518
|
+
request.config.results["expected_path"] = expected_path
|
|
519
|
+
request.config.results["stream"] = obj.pages[0].read()
|
|
508
520
|
assert obj.pages[0].read() == f.read()
|
|
509
521
|
|
|
510
|
-
with open(
|
|
511
|
-
os.path.join(pdf_samples, "pages", "sample_template_page_2.pdf"), "rb+"
|
|
512
|
-
) as f:
|
|
513
|
-
assert obj.pages[1].read() == f.read()
|
|
514
|
-
|
|
515
|
-
with open(
|
|
516
|
-
os.path.join(pdf_samples, "pages", "sample_template_page_3.pdf"), "rb+"
|
|
517
|
-
) as f:
|
|
518
|
-
assert obj.pages[2].read() == f.read()
|
|
519
|
-
|
|
520
522
|
|
|
521
523
|
def test_generate_coordinate_grid(template_stream, pdf_samples, request):
|
|
522
524
|
expected_path = os.path.join(pdf_samples, "test_generate_coordinate_grid.pdf")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|