Skip to main content
June 10, 2016
Answered

Change Acrobat Cropbox from Javascript for Automation

  • June 10, 2016
  • 1 reply
  • 1259 views

Hi everyOne

I'm accessing some data inside PDF doc trough Javascript for Automation of OSX

I can get the cropBox.... "var cropBoxx = acro.activeDoc.pages.cropBox();"

But how can i SET the cropbox

"acro.activeDoc.pages.cropBox.value='0, 1224, 192, 612';"...doesn't work

Maybe i'm far of the right way to send data to acrobat

Does someone can guide me

Thanks

This topic has been closed for replies.
Correct answer

No.. i know it's not Acrobat javascript

That's why i'v mentionned (Javascript for Automation of OSX)

The javascript side of Applescript ... since Yosemite

I'v tried every possiblilty of 0, 1224, 192, 612 or [0, 1224, 192, 612] or ([0, 1224, 192, 612])

it doesn't work

So maybe Someone else have played with (Javascript for Automation)

and have a answer

Thanks


ok i'v got it

At least i can set it to a specific page

acro.activeDoc.pages[0].cropBox = [0, 1224, 192, 612];

1 reply

try67
Community Expert
Community Expert
June 10, 2016

Not sure what this is, but it's not JavaScript...

June 10, 2016

In the (Javascript for Automation) of OSX

var cropBoxx = acro.activeDoc.pages.cropBox();

Return:

..

app = Application("Acrobat")

    Application("Adobe Acrobat Pro").activeDoc.pages.cropBox()

        --> [[0, 1224, 792, 612]]

..

If they call it (Javascript for Automation)

I guess is Javascript

try67
Community Expert
Community Expert
June 10, 2016

Maybe, but it's not Acrobat JavaScript. Sounds like a scripting language of the OS itself.

Anyway, it seems from your example that you need to specify an array (or an array with an array as the first value).