From 30326287a43870750ca28d702d362722f23822bc Mon Sep 17 00:00:00 2001 From: "Jorj X. McKie" Date: Mon, 17 Apr 2023 11:29:38 -0400 Subject: [PATCH] fitz/utils.py src/utils.py: Re-apply fix for #2345 that was unintentionally reverted. Previously we displayed error messages (Python `print()`) if a link could not be replicated on the target page within method `doc.insert_pdf()`. As the method has no way to provide more information on the problem's cause, and hence cannot provide information on how to fix the problems, the messages make no sense and will be omitted. --- fitz/utils.py | 4 +--- src/utils.py | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/fitz/utils.py b/fitz/utils.py index 069b1d2d4..ea3f0e9a9 100644 --- a/fitz/utils.py +++ b/fitz/utils.py @@ -1596,9 +1596,7 @@ def cre_annot(lnk, xref_dst, pno_src, ctm): if l["kind"] == LINK_GOTO and (l["page"] not in pno_src): continue # GOTO link target not in copied pages annot_text = cre_annot(l, xref_dst, pno_src, ctm) - if not annot_text: - print("cannot create /Annot for kind: " + str(l["kind"])) - else: + if annot_text: link_tab.append(annot_text) if link_tab != []: page_dst._addAnnot_FromString(tuple(link_tab)) diff --git a/src/utils.py b/src/utils.py index ca0a372da..23e86784c 100644 --- a/src/utils.py +++ b/src/utils.py @@ -1630,8 +1630,6 @@ def cre_annot(lnk, xref_dst, pno_src, ctm): annot_text = cre_annot(l, xref_dst, pno_src, ctm) if annot_text: link_tab.append(annot_text) - else: - print("cannot create /Annot for kind: " + str(l["kind"])) if link_tab != []: page_dst._addAnnot_FromString( tuple(link_tab)) #fitz.log( 'utils.do_links() returning.')