From b4af495b25180914acd9593830e44a8d6a2b8b7d Mon Sep 17 00:00:00 2001 From: j-t-1 <120829237+j-t-1@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:07:36 +0000 Subject: [PATCH] STY: Use OutlineFontFlag (#2985) --- pypdf/_writer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pypdf/_writer.py b/pypdf/_writer.py index f43f37ec1..138b33724 100644 --- a/pypdf/_writer.py +++ b/pypdf/_writer.py @@ -75,6 +75,7 @@ GoToActionArguments, ImageType, InteractiveFormDictEntries, + OutlineFontFlag, PageLabelStyle, TypFitArguments, UserAccessPermissions, @@ -3336,9 +3337,9 @@ def _create_outline_item( if italic or bold: format_flag = 0 if italic: - format_flag += 1 + format_flag += OutlineFontFlag.italic if bold: - format_flag += 2 + format_flag += OutlineFontFlag.bold outline_item.update({NameObject("/F"): NumberObject(format_flag)}) return outline_item