1 person found this helpful
If you have Acrobat Pro you can do it in a batch process (aka Action) and
change all of your files at the same time.
AFAIK, it's not possible to do it with a script.
Thank you for the reply.
Is that different than a Batch Sequence? I've tried using the Optimize Scanned PDF in my Batch Sequence, but it throws this error:
Running Scanned Image Optimization is not possible on this document
Command: Optimize Scanned PDF
Any thoughts? Or is there a different way to do it with batch processing?
OK, I got it!
I didn't see you could specify "optimize..." in the output options.
I have another problem now though because I need my folder level script to be able to know where those output PDFs are so that I can merge the "optimized" PDFs into a new document (I can't overwrite the original PDFs with their new optimized counterparts).
1 person found this helpful
Not really... Are you always using the same output folder? If so, then you
can hard-code it into the script.
Or you can run another batch process at the end that collects the paths
of the files after you optimized them.
Thanks again for your reply!
Well the output folder could change... and really, it would be most ideal to not even save the single PDFs (although it looks like I might have to). All I need to accomplish is to take a folder of PDFs and merge them into one PDF (but it must be optimized and cropped). I don't need the new, saved versions of the single PDFs. I feel like my "automation" solution to this will end up being more tedious than manually clicking "combine" and merging PDFs that way, and applying the crop settings afterward. Maybe I am making this more difficult than it needs to be? Here is what I'm doing:
1. I have a folder level script that executes when Acrobat loads whichs adds two menu items. The first opens up the Batch Sequences menu so the user doesn't have to find them.
2. From here, the user will need to run a batch sequence that will optimize and crop each PDF and save them to an output folder.
3. Now the user will need to run another batch sequence (and choose the output folder from step 2 as the input folder now) that will collect all the file paths of the optimized PDFs.
4. Now the user can use my other menu item from step 1 that will execute a folder level script and merge the PDFs by inserting them into a new document.
5. I can prompt the user here to save the new document somewhere.
It seems like there should be an easier way to do this. Is it not possible to merge the PDFs in a batch sequence and then use the output folder to save the one new PDF (rather than each of the input PDFs)?
Why not first merge all the files to a single PDF, and then crop and
optimize that one file?
Then you'll have only the one batch process (to collect the file paths),
and one folder-level script to combine the selected paths, and then crop
and optimize the merged file.
I could, but I'd first have to run a batch sequence to get the filepaths of the original PDFs to merge. Then I could run a folder level script that would merge them, and the user would have to save it. Then I could run the "optimize" batch sequence to update that one file and then re-save it to the same location. Is that what you were thinking? Thats a little simpler.
I think you might be able to optimize the file using the preflight method.
Then you won't need the last batch process.
I do like the other idea though, merging them and then optimizing the one with the last batch. Thanks!!
There's a method of the Document object called preflight that can execute a
pre-existing PreflightProfile, so if you create the profile in advance, and
you only need to execute it on the one file, then you don't need the extra
Thanks, I must be looking at something wrong?
Is there a newer JS API Reference than version 8?
It was introduced in version 9. You can find it here:
Alternatively, you can download the Acrobat X SDK, where the latest version
of the JS API Reference can be found.
Awesome, thanks so much. I appreciate all of your help.