Skip to content

Commit

Permalink
fitz/utils.py src/utils.py: Re-apply fix for pymupdf#2345 that was un…
Browse files Browse the repository at this point in the history
…intentionally 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.
  • Loading branch information
JorjMcKie authored and julian-smith-artifex-com committed Nov 23, 2023
1 parent 724c63b commit 3032628
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 1 addition & 3 deletions fitz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down

0 comments on commit 3032628

Please sign in to comment.