Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Change Acrobat Cropbox from Javascript for Automation

Guest
Jun 10, 2016 Jun 10, 2016

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

TOPICS
Acrobat SDK and JavaScript
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Jun 10, 2016 Jun 10, 2016

ok i'v got it

At least i can set it to a specific page

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

Translate
Community Expert ,
Jun 10, 2016 Jun 10, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 10, 2016 Jun 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 10, 2016 Jun 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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 10, 2016 Jun 10, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 10, 2016 Jun 10, 2016
LATEST

ok i'v got it

At least i can set it to a specific page

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines