GoToR link opens target PDF but always jumps to top — how to open at exact position? #4782
Answered
by
JorjMcKie
BaigMirzaTouqir
asked this question in
Looking for help
-
|
I'm implementing cross-PDF linking with PyMuPDF (fitz) for an automation pipeline where one PDF needs to open another PDF at a specific bookmark location. The link works — it opens the correct file — but the viewer (e.g., Adobe Acrobat) always scrolls to the top of the target page, not to the precise bookmark coordinates. Here’s the relevant code snippet: import fitz
link_details = {
"kind": fitz.LINK_GOTOR,
"file": relative_link, # relative path from source to target
"page": adjusted_page_no, # 0-based index of target page
"to": target_point, # bookmark rect value (x, y)
"zoom": 0,
"from": inst_rect # clickable rectangle in source PDF
}
source_page.insert_link(link_details) |
Beta Was this translation helpful? Give feedback.
Answered by
JorjMcKie
Nov 10, 2025
Replies: 1 comment
-
|
This is technically impossible - PDF specification restriction, not a PyMuPDF one. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
JorjMcKie
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is technically impossible - PDF specification restriction, not a PyMuPDF one.