Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pypdf/generic/_data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,8 @@ def __init__(

# from table 8.2 of the PDF 1.7 reference.
if typ == "/XYZ":
if len(args) < 3: # zoom is missing
args.append(NumberObject(0.0))
(
self[NameObject(TA.LEFT)],
self[NameObject(TA.TOP)],
Expand Down
12 changes: 12 additions & 0 deletions tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,3 +1156,15 @@ def test_iss1615_1673():
reader = PdfReader(BytesIO(get_pdf_from_url(url, name=name)))
writer = PdfWriter()
writer.clone_document_from_reader(reader)


@pytest.mark.enable_socket()
def test_destination_withoutzoom():
"""Cf issue #1832"""
url = (
"https://raw.githubusercontent.com/xrkk/tmpppppp/main/"
"2021%20----%20book%20-%20Security%20of%20biquitous%20Computing%20Systems.pdf"
)
name = "2021_book_security.pdf"
reader = PdfReader(BytesIO(get_pdf_from_url(url, name=name)))
reader.outline