Batch-Optimizing of PDF Files
Introduction
The tutorial shows how to optimize of multiple PDF files using the PDF Optimizer tool of the Adobe® Acrobat® Pro. The PDF Optimizer feature of Adobe Acrobat is designed for managing fonts, images, and document content of PDF files. It is often used to reduce the file size and/or make PDF documents to comply with a specific version of PDF file format. The tutorial is using the AutoBatch™ plug-in to launch processing from outside of Adobe® Acrobat®.
The tutorial provides the step-by-step instructions for:
  • Creating Action Wizard "action" that optimize file size of all PDF files from a folder.
  • Creating a batch file (*.bat) for starting the optimization from outside of the Adobe® Acrobat®.
  • Executing the file optimization job.
Prerequisites
You need a copy of the Adobe® Acrobat® Pro along with the AutoBatch™ plug-in installed on your computer in order to use this tutorial. You can download trial versions of both the Adobe® Acrobat® and the AutoBatch™ plug-in.
Step 1 - Start the Action Wizard Tool
Start the Adobe® Acrobat® Pro application. Click on "Tools" panel. Double click on the "Action Wizard" tool icon to open the tool controls.
Start the Action Wizard
Step 2 - Create a New "Action"
Click on the "New Action" icon on the "Action Wizard" toolbar to create a new batch processing "action".
Create new action
Step 3 - Add "Save" Command
The PDF Optimizer functionality is provided by the "Save" command. If the goal is to only optimize PDF files, then the "action" needs only one "Save" command. Expand the "Save & Export" tools category and find "Save" command in the list:
Expand the Save & Export category
Double click on a "Save" command:.
Add the Save
Step 4 - Specify an Output Folder
Now we need to select an output folder where to save the optimized PDF files. It is good idea to keep the original and optimized PDFs separate in case you would need to go back and re-do the processing. Click the "OK" icon next to the "Save" command.
Click the OK icon
Select "Save to Local Folder" from the pull-down list.
Select Save to Local Folder
Select an output folder where to save the resulting files in. Click "OK" once done.
Select an output folder
Step 5 - Specify the Optimization Settings
Click "Specify Settings" below the "Save to Local Folder" action step.
Click Specify Settings
Make sure that the "Save File(s) As Adobe PDF" option is checked in the "Output Options" dialog.
Check the "PDF Optimizer" option box. Click the "Settings..." button.
Check the PDF Optimizer box
The PDF Optimizer provides many settings for reducing the size of PDF files. In most cases, the default settings are appropriate for maximum efficiency-saving space by removing embedded fonts, compressing images, and removing items from the file that are no longer needed. To use the default settings, choose "Standard" from the Settings menu in the "PDF Optimizer" dialog.
Alternatively, specify settings according to your requirements and click "OK" once done. Use the options from the panels in the "PDF Optimizer" dialog box to reduce the size of a PDF.
PDF Optimizer Options (Acrobat® Pro)
The Images panel of the PDF Optimizer lets you set options for color, grayscale, and monochrome image compression, and image downsampling.
Fonts panel: to ensure an exact match to the source document, it`s a good idea to embed all fonts used in the document. If you don`t need an exact match and you prefer a smaller file, you can choose not to embed fonts for roman text and East Asian text (Traditional Chinese, Simplified Chinese, Korean, and Japanese). Text in these languages is replaced with a substitution font when viewed on a system that does not have the original fonts.
Transparency panel: if your PDF includes artwork that contains transparency, you can use presets in the Transparency panel of PDF Optimizer to flatten transparency and reduce file size. (Flattening incorporates transparency into corresponding artwork by sectioning it into vector-based areas and rasterized areas.) PDF Optimizer applies transparency options to all pages in the document before applying other optimization options. Note that transparency flattening cannot be undone after the file is saved.
 The Discard Objects panel lets you specify objects to remove from the PDF and lets you optimize curved lines in CAD drawings. You can discard objects created in Acrobat and in other applications. Selecting an object removes all occurrences of that object within the PDF.
 Use the Discard User Data panel to remove any personal information that you don`t want to distribute or share with others. If you`re unable to find personal information, it may be hidden. You can locate hidden text and user-related information by using the Examine Document command (Tools > Protection >Remove Hidden Information).
 The options in the Clean Up panel of the PDF Optimizer remove useless items from the document. These items include elements that are obsolete or unnecessary for your intended use of the document. Removing certain elements can seriously affect the functionality of the PDF. By default, only elements that do not affect functionality are selected. If you are unsure of the implications of removing other options, use the default selections.
Specify optimization settings
Click "OK" in the "Output Options" dialog.
Close the dialog
Step 7 - Specify a Folder to Process
Click the "Add Folder" icon in the "Files to be Processed" section.
Click the Add Folder icon
Select a folder that contains files to be optimized. Click "OK" once done.
Select an input folder
Step 8 - Save the Action
The action is now configured. We have specified both input and output folders and the file optimization settings. Click "Save" button to save the action.
Click Save
Type a desired "Action Name" and, optionally, enter a description into the "Action Description" box. We have named the action as "PDF Optimizer" in the tutorial. Click "Save" to save the action.
Type desired action name and description
The action can be used now in the Action Wizard tool by manually starting it from the actions list. No further steps are necessary, unless the action needs to be executed from outside of the Adobe® Acrobat®.
Step 9 - Create Batch File (*.bat)
The new action is now listed in the "Actions List" of the Action Wizard tool and can be started by double-clicking on it.
Now we are going to create a command-line batch file (*.bat) that can be used to execute the action from outside of the Adobe® Acrobat®. This functionality requires the AutoBatch™ plug-in. The batch file is auto-generated based on the user-selected parameters.
Select "Plug-Ins > Create Batch File..." from the Adobe® Acrobat® main menu to open the "Create Command-Line Batch File" dialog.
Open the Create Command-Line Batch File dialog
Select the created action from the "Select Acrobat Action" list. We have selected the "PDF Optimizer" action in the tutorial.
Select "Do nothing" from the "Select Final Action:" list unless input files need to be moved or copied after the processing.
Optionally, check the "Create a Task-Scheduler Compatible batch file" option box to create a file that will execute silently without displaying any windows.
Specify batch file
Step 10 - Specify Processing File Types (Optionally)
The processing file types could be restricted. The AutoBatch™ allows to specify file types that would be processed. Click "File Types..." to specify processing file types.
Restrict file types
Check the "Process only the following file types" option. Type desired file extensions separated by comma in the text field. We have entered "pdf" to process only files with *.pdf file extension. This will exclude other file types from the optimization process if such files are placed in the input folder.
Click "OK" to save and exit the dialog.
Type desired file extensions
Step 11 - Save Batch File (*.bat)
Click the "Create Batch File..." button to auto-generate a batch file.
Create batch file
Specify a folder and a file name for the batch file. We have named the file as "AutoBatch PDF Optimizer.bat" in the tutorial. Click "Save" to save the action.
Specify batch file name
Click "Close" to close the "Create Command-Line Batch File" dialog.
Close the dialog
Step 12 - Close the Adobe® Acrobat®
Use "File > Exit" menu to close the Adobe® Acrobat® application.
Close the Adobe Acrobat
Step 13 - Run the Batch File
Now open the folder where "AutoBatch PDF Optimizer.bat" file is located and double click on it to execute.
Run the batch file
The batch file will optimize multiple PDF files from the input folder and save them into the output folder as specified in the Action Wizard "action". It is possible to pass a custom input folder or filename to the BAT file for processing. The custom filename passed as a parameter will overwrite the input file selection in the Action Wizard "action".
The batch file will be executed
Advanced: Using Different Input and Output Folders
It's possible to override an input/output file or folder selection in "action" and pass a different file or a folder path. It allows using the same "action" with different input/output files and folders without editing the "action" itself. You can pass a custom input/output file or folder path as a batch file parameter (see example below). The alternative path is going to be used instead of input/output file or folder specified in the original "action". The alternative paths(s) can be passed either in the Windows Command-Prompt or as part of the another BAT file.
Using another BAT file
Use "CALL" statement to pass different parameters as part of another BAT file. Multiple jobs can be started from a single BAT file while passing different input/output folders. Use any plain text editor to create a BAT file with different input/output folders passed as the parameters:
CALL AutoBatch_PDF_Optimizer.BAT "c:\pdf\June\"
CALL AutoBatch_PDF_Optimizer.BAT "c:\pdf\July\"
CALL AutoBatch_PDF_Optimizer.BAT "c:\pdf\August\"
The BAT file can be executed by double-clicking on it in the Windows Explorer window.
Using the Command-Prompt
The following examples show how to pass alternative folder paths using the Command Prompt. Press Win+R on the keyboard to open the Run window. Type cmd or cmd.exe and press Enter. This will launch the Command window. Navigate to the folder where the BAT file is located and type the following commands.
[c:\] AutoBatch_PDF_Optimizer.BAT "c:\data\pdfs\"
The above command-line will process all files in "c:\data\pdfs" folder instead of "c:\Input Folder" folder that is specified in the original sequence description.
[c:\] AutoBatch_PDF_Optimizer.BAT "c:\data\pdfs\" "c:\data\reduced\"
The above command-line will process all files in "c:\data\pdfs" folder instead of "c:\Input Folder" folder that is specified in the original sequence description and output processed files into "c:\data\reduced\" folder.
Click here for a list of all step-by-step tutorials available.