From b7bfd0d7eddfd0865a94cc9e7027df6596242cf7 Mon Sep 17 00:00:00 2001 From: rsinger417 <159086296+rsinger417@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:42:56 -0600 Subject: [PATCH] BUG: Use NumberObject for /Border elements of annotations (#2451) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As defined in Table 164 – Entries common to all annotation dictionaries, the /Border Array consists of NumberObjects. Previously, pypdf used NameObject which is wrong. The previous version caused a warning in the class NameObject: "Incorrect first char in NameObject:({self})". Fixes #2444 --- pypdf/annotations/_markup_annotations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pypdf/annotations/_markup_annotations.py b/pypdf/annotations/_markup_annotations.py index c5e0a2fed..4022fba2a 100644 --- a/pypdf/annotations/_markup_annotations.py +++ b/pypdf/annotations/_markup_annotations.py @@ -325,9 +325,9 @@ def __init__( border_arr: BorderArrayType if border is not None: - border_arr = [NameObject(n) for n in border[:3]] + border_arr = [NumberObject(n) for n in border[:3]] if len(border) == 4: - dash_pattern = ArrayObject([NameObject(n) for n in border[3]]) + dash_pattern = ArrayObject([NumberObject(n) for n in border[3]]) border_arr.append(dash_pattern) else: border_arr = [NumberObject(0)] * 3