These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Hi, how do I get or convert crop box size

Paeon
Registered: Apr 12 2007
Posts: 30

I'm using applescript and I have this code

tell application "Adobe Acrobat Professional"
set mbox to media box of page 1 of document 1
end tell

it gives me the dimensions in "PDF space" whatever that is. What I'm trying to do is find the page size after a pdf has been cropped. You can't get it from the metadata, at least not using applescript.

So when I ask for the media box, say I get a list (left, top, bottom, right) {0.0, 720.0, 720, 0.0} this is for a doc that's 10" by 10". I crop the pdf to 9.5" by 9.5". I ask for the crop box and I get a list {18.0, 720.0, 720.0, 18.0}. How would I translate that into 9.5" by 9.5"? What is PDF space?

I looked at the API reference and that's cursory at best.

Thanks.

My Product Information:
Acrobat Pro 7.0.9, Macintosh
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi Paeon,

This article at JavaScript Corner explains PDF page boundaries-
http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/page_bounds/

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
Paeon
Registered: Apr 12 2007
Posts: 30
I think I get it. In order to get the page size in w x h, you have to subtract the left coordinate from the right coordinate, then the bottom coordinate from the top coordinate. for instance in order to get 9.5" or I'd take a left coordinate of 18.0 pts and subtract that from a right coordinate of 702.0 pts, then divide by 72.

So I need to put each coordinate into its own variable first.

Thanks, this helps me think it through.