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

Could I optimize a pdf doc by using acrobat javascript?

gavin2u
Registered: Jul 3 2009
Posts: 76
Answered

Okay, friends,

I wanna get my PDF files optimized by using acrobat javascript, is it possible?

'cance I notice a menu item 'Advanced -> PDF Optimizer...', and it can considerably reduce my pdf file size.

app.execMenuItem() method can not do this, is there any method?

Regards,

- gavin

My Product Information:
Acrobat Pro 9.0, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You can't optimize the files directly with JS, but you *can* use the execMenuItem method to open the optimization window.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gavin2u
Registered: Jul 3 2009
Posts: 76
try67 wrote:
You can't optimize the files directly with JS, but you *can* use the execMenuItem method to open the optimization window.
Thanks try67, :)

I'd like to optimize my PDF files manually. emm.. what a pity...
Greenstead
Registered: Jul 1 2009
Posts: 17
But when you use the execMenuItem method it is followed by two alert questions from Acrobat. Is there any way to push the OK button from js ?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
No, that can't be automated using JS.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Actually, you can run a preflight profile with the doc.preflight() function. So, if there is an existing profile, or you can create one that does your particular optimization, then you are in business.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
With the Professional versions before Acrobat X you can use Batch Processing and in Acrobat X Professional you can use Actions to optimize the saved files as part of the batch processing.

George Kaiser