Skip to content

Commit

Permalink
BUG: Fix AnnotationBuilder.link (#2066)
Browse files Browse the repository at this point in the history
The object was not updating itself, but a temporary variable in it

Closes #2058
  • Loading branch information
MartinThoma authored Aug 6, 2023
1 parent 0987346 commit 7e9292c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pypdf/annotations/_markup_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def __init__(
else:
border_arr = [NumberObject(0)] * 3

link_obj = DictionaryObject(
self.update(
{
NameObject("/Type"): NameObject("/Annot"),
NameObject("/Subtype"): NameObject("/Link"),
Expand All @@ -340,7 +340,7 @@ def __init__(
}
)
if is_external:
link_obj[NameObject("/A")] = DictionaryObject(
self[NameObject("/A")] = DictionaryObject(
{
NameObject("/S"): NameObject("/URI"),
NameObject("/Type"): NameObject("/Action"),
Expand All @@ -356,4 +356,4 @@ def __init__(
"fit_args": fit.fit_args,
}
)
link_obj[NameObject("/Dest")] = dest_deferred
self[NameObject("/Dest")] = dest_deferred

0 comments on commit 7e9292c

Please sign in to comment.