Page 1 of 1

JS - Executes a menu command in Acrobat Pro

Posted: Tue Mar 28, 2023 9:10 am
by Frank0
Hi,
I need a javascript that executes a menu command in the Adobe Acrobat Pro app ('Reduce file size' when saving).

We use Acrobat Pro as a connector in Switch and the script should execute the menu command.

Can anyone help me with this?

Many thanks

Frank

Re: JS - Executes a menu command in Acrobat Pro

Posted: Tue Mar 28, 2023 9:24 am
by jan_suhr
This requires that you run a Script in Acrobat, not in Switch

In the Acrobat configurator you can in the Command property set it to "Use script" and that is a script that runs in Acrobat.
You can probably find such a script if you search the web, note that there are a few special things when running an Adobe script in Switch, the Switch documentation describes how to do it.

Re: JS - Executes a menu command in Acrobat Pro

Posted: Tue Mar 28, 2023 9:39 am
by loicaigon
Hi,

I can't find any available method in the Adobe Acrobat JS API to reduce file size. Once that said, have you tried the built-in "Optimization" property in the PitStop Server configurator? You also have the ability to create your own action list to dramatically reduce file sizes.

I understand it's not your request but if you tried the above technique and somehow got unsatisfied, I would be interested in knowing why exactly.

HTH

Loic

Re: JS - Executes a menu command in Acrobat Pro

Posted: Tue Mar 28, 2023 10:44 am
by Frank0
Hello Jan, Hello Loic,
thanks you for your answers.

@Jan - ok, then I have to insert the command in Acrobat. I would have thought that I could give that in Switch to the Connector and it will run it in Acrobat. But, ok

@Loic, I had used a (default) action list, but it didn't give me the size I needed. And in the 'Optimize PDF' action list is already pretty much everything in there. Only in Acrobat itself, you come with the save (reduce file size) even further down.

Thanks
Frank

Re: JS - Executes a menu command in Acrobat Pro

Posted: Tue Mar 28, 2023 1:18 pm
by laurentd
As far as I know, "reduce file size" is not available in Adobe Acrobat JS (ExtendScript).
You can use a PitStop Action list as Loic suggests.
There is also an app in your favorite Appstore, called Optimize PDF.
Give it a try!