Skip to content

Commit c819acb

Browse files
authored
ROB: Add required line separators in ContentStream ArrayObjects (#1281)
Closes #1278
1 parent b63085e commit c819acb

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

PyPDF2/generic/_data_structures.py

+2
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,8 @@ def __init__(
679679
data = b""
680680
for s in stream:
681681
data += b_(s.get_object().get_data())
682+
if data[-1] != b"\n":
683+
data += b"\n"
682684
stream_bytes = BytesIO(data)
683685
else:
684686
stream_data = stream.get_data()

tests/test_page.py

+5
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@ def test_iss_1142():
265265
"https://github.com/py-pdf/PyPDF2/files/9150656/ST.2019.PDF",
266266
"iss_1134.pdf",
267267
),
268+
# iss 1:
269+
(
270+
"https://github.com/py-pdf/PyPDF2/files/9432350/Work.Flow.From.Check.to.QA.pdf",
271+
"WFCA.pdf",
272+
),
268273
],
269274
)
270275
def test_extract_text_page_pdf(url, name):

0 commit comments

Comments
 (0)