diff --git a/pypdf/annotations/_markup_annotations.py b/pypdf/annotations/_markup_annotations.py index 76ca5439d..e4233412d 100644 --- a/pypdf/annotations/_markup_annotations.py +++ b/pypdf/annotations/_markup_annotations.py @@ -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"), @@ -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"), @@ -356,4 +356,4 @@ def __init__( "fit_args": fit.fit_args, } ) - link_obj[NameObject("/Dest")] = dest_deferred + self[NameObject("/Dest")] = dest_deferred