1
0
Fork 0

Merging upstream version 0.2.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-08 07:40:28 +01:00
parent 53c7599f12
commit fe219838ef
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
13 changed files with 159 additions and 116 deletions

View file

@ -1,3 +1,5 @@
import io
import pydyf
from . import assert_pixels
@ -283,10 +285,10 @@ def test_transform():
document = pydyf.PDF()
draw = pydyf.Stream()
draw.transform(1, 0, 0, 1, 1, 1)
draw.move_to(2, 2)
draw.set_line_width(2)
draw.line_to(2, 5)
draw.transform(1, 0, 0, 1, 1, 1)
draw.stroke()
document.add_object(draw)
@ -694,7 +696,7 @@ def test_text():
KKKKKKKKKK
KKKKKKKKKK
KKKKKKKKKK
__________
zzzzzzzzzz
__________
__________
__________
@ -702,6 +704,20 @@ def test_text():
''')
def test_identifier():
document = pydyf.PDF()
pdf = io.BytesIO()
document.write(pdf, identifier=b'abc')
assert b'abc' in pdf.getvalue()
def test_version():
document = pydyf.PDF()
pdf = io.BytesIO()
document.write(pdf, version=b'2.0')
assert b'2.0' in pdf.getvalue()
def test_string_encoding():
assert pydyf.String('abc').data == b'(abc)'
assert pydyf.String('déf').data == b'<feff006400e90066>'