Description of the bug
Copying pages togther with links from one document to another leads to wrong coordinates in the copied document, see reproducer below.
How to reproduce the bug
import pymupdf
document = pymupdf.Document()
document.new_page()
document[0].set_rotation(90)
document[0].insert_link({'kind': 2, 'from': pymupdf.Rect(10, 20, 40, 60), 'uri': 'https://example.org'})
document_copy = pymupdf.Document()
document_copy.insert_pdf(document, links=True)
print('orig:', *(l['from'] for l in document[0].get_links()))
print('copy:', *(l['from'] for l in document_copy[0].get_links()))
prints
orig: Rect(782.0, 10.0, 822.0, 40.0)
copy: Rect(802.0, 782.0, 832.0, 822.0)
PyMuPDF version
1.27.2
Operating system
Linux
Python version
3.14
Description of the bug
Copying pages togther with links from one document to another leads to wrong coordinates in the copied document, see reproducer below.
How to reproduce the bug
prints
PyMuPDF version
1.27.2
Operating system
Linux
Python version
3.14