Sunday, November 29, 2020

#1 2010-04-06 02:04:55 pm

Martin Michel
Administrator
From:: Berlin, Germany
Registered: 2008-03-03
Posts: 701
Website

How to set the trim/art/crop/media box of a PDF with AppleScript?

Hi,

I need to set the trim box of 42 PDF documents and would like to automate this process. But before writing a script from scratch I would like to ask if someone already created such a droplet or can kindly provide some sample code.

I have Acrobat Pro 7-9 available in our department, also the Creative Suite CS2-4. I am open to all solutions (JavaScript, CLI) big_smile

Thanks so much in advance!

Best regards from (way too) busy Berlin,

Martin


Plonum - Convert images to iWork Numbers documents

Offline

 

#2 2010-04-06 02:57:14 pm

Mark67
Member
Registered: 2005-12-22
Posts: 780

Re: How to set the trim/art/crop/media box of a PDF with AppleScript?

Martin, the boxes are easily set its just the measurement is in points. This would crop off 10mm, bleed 5mm in from that trim 5mm in again…

Applescript:

tell application "Adobe Acrobat 7.0 Professional"
   activate
   tell active doc
       repeat with i from 1 to count of pages
           tell page i
               set {L, T, R, B} to media box
               set crop box to {L + 10 * 2.834645, T - 10 * 2.834645, R - 10 * 2.834645, B + 10 * 2.834645}
               set bleed box to {L + 15 * 2.834645, T - 15 * 2.834645, R - 15 * 2.834645, B + 15 * 2.834645}
               set trim box to {L + 20 * 2.834645, T - 20 * 2.834645, R - 20 * 2.834645, B + 20 * 2.834645}
           end tell
       end repeat
   end tell
end tell

Offline

 

#3 2010-04-07 02:14:38 am

Martin Michel
Administrator
From:: Berlin, Germany
Registered: 2008-03-03
Posts: 701
Website

Re: How to set the trim/art/crop/media box of a PDF with AppleScript?

Hi Mark,

Your script works a treat! I have no experience with Acrobat Pro yet, so you really helped me a lot with this.

May you have a wonderful day wink

Best regards,

Martin


Plonum - Convert images to iWork Numbers documents

Offline

 

#4 2012-06-27 08:19:32 am

mbarzizza
Member
Registered: 2012-06-21
Posts: 1

Re: How to set the trim/art/crop/media box of a PDF with AppleScript?

Mark67,
I am new to applescript as well but am extremely interested in how it works. If you wouldn't mind, could you explain where you got the 2.834645 that you are using in your script? I would greatly appreciate it. Thanks so much,
Mbarzizza

Offline

 

#5 2012-06-27 09:34:18 am

Mark67
Member
Registered: 2005-12-22
Posts: 780

Re: How to set the trim/art/crop/media box of a PDF with AppleScript?

It's a points to millimeter conversion value… The *.pdf stores points and I like metric… It's best put in a variable mm then in script editor it almost look right… 20*mm

Last edited by Mark67 (2012-06-27 09:37:26 am)

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)