Skip to content

Commit

Permalink
Update _writer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rsinger417 authored Feb 8, 2024
1 parent c1d3459 commit 7fb4d9e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pypdf/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2130,9 +2130,8 @@ def add_annotation(
if to_add.get("/Subtype") == "/Link" and "/Dest" in to_add:
tmp = cast(Dict[Any, Any], to_add[NameObject("/Dest")])
# Changes target_page_index an integer to target_page an IndirectObject
page.annotations.append(self._add_object(to_add))
target_page = pages_obj[PA.KIDS][tmp["target_page_index"]]
pages_obj = cast(Dict[str, Any], self.get_object(self._pages))
target_page = pages_obj[PA.KIDS][tmp["target_page_index"]]
dest = Destination(
NameObject("/LinkName"),
target_page,
Expand Down

0 comments on commit 7fb4d9e

Please sign in to comment.