Cropbox issue

hello, with the attached file I do:

import pymupdf
doc = pymupdf.open(“crop2.pdf”)
for page_index in range(len(doc)):
    page = doc[page_index]print(“MediaBox:”)print(page.mediabox)print(“CropBox:”)print(page.cropbox)

And it gives:

MediaBox:
Rect(0.0, 0.0, 612.0, 792.0)
CropBox:
Rect(284.8609924316406, 0.0, 612.0, 341.8240051269531)

However if I use mutool with : mutool show crop2.pdf 13

It gives:

CropBox [ 284.861 450.176 612 792 ]

crop2.pdf (12.4 KB)

I believe that mutool is correct though! Any ideas @HaraldLieder ?

Both are correct!
You are quoting from the PDF definition itself which therefore is in PDF’s coordinate system.
The y-coordinates have to be re-computed according to formula height - y.
This gives y-values 792 - 450.176 = 341,824 and 792 - 792 = 0, respectively.

Of course I was forgetting about this: Appendix 3: Assorted Technical Information - PyMuPDF 1.26.3 documentation
Thanks!