I have some pdf files created by Adobe InDesign (with bleed setting). And I want to crop only the "TrimBox" range of every page to image. Is it possible to get the coordinate?
I can get the info with code:
>>> doc = fitz.open("trimbox.pdf")
>>> page = doc.load_page(0)
>>> xref = page.xref
>>> doc.xref_get_key(xref, "TrimBox")
('array', '[36.8499 36.8499 632.126 878.74]')
>>> doc.xref_get_key(xref, "BleedBox")
('array', '[28.346 28.346 640.629 887.244]')
#
>>> page.mediabox
Rect(0.0, 0.0, 668.9760131835938, 915.5900268554688)
>>> page.cropbox
Rect(0.0, 0.0, 668.9760131835938, 915.5900268554688)
page.trimbox
page.bleedbox
I have some pdf files created by Adobe InDesign (with bleed setting). And I want to crop only the "TrimBox" range of every page to image. Is it possible to get the coordinate?
I can get the info with code:
Is there more simple way to do this? Like:
trimbox.pdf