Pymupdf insert link issue #2042
Unanswered
Mano2731995
asked this question in
Looking for help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hai everyone,
I need to map to string(hot area text) and pdf embedded file (attachments)
When I try click the string, attachment should be open.
Here is the code
import fitz
doc=fitz.open('C:\xxx.pdf')
PdfAttachments=['abc.pdf']
String=['python']
for(j, k) in zip(String, pdfAttachments) :
for page in doc:
Text= page. Search_for(j)
for i in text:
Link= page. Insert_link({'kind':2, 'from':fitz.Rect(i.x0, i.y0, i.x1, i.y1), 'uri':k})
Doc. Save(op.pdf)
Expected result: click the 'python', abc. Pdf should be open
(Note: xxx. Pdf contains abc. pdf)
Actutal result:Code running no error but string not linked to attachment document
Beta Was this translation helpful? Give feedback.
All reactions