Entering a Command Prompt
To use the product, enter a statement from a command prompt, and manually flatten one PDF document at a time. Or you could add a PDF Forms Flattener command statement to a batch or shell script file to automate the process. This way you can create a workflow that uses the PDF Forms Flattener to flatten large numbers of PDF documents automatically. You can use your favorite script language to automatically generate a series of calls to PDF Forms Flattener, each with a unique name for the input PDF document and the output file.
The command syntax for Forms Flattener must include:
- PDFFormsFlattener Executable file name
- -i [--input] Path to the PDF form input document
- -o [--output] Path to where the output PDF document will be saved
You can also add this optional value to import data into the blank fields on a PDF form document.
- -d [--import] Path to the forms input data file. For XFA documents this file must have extension .xdp, .xfd, or .xml. For AcroForm documents this file must have extension .xfdf, .fdf, or .xml.
For each command line option, you can use the short (“-i”) or long (“--input”) notation.
A command statement for the PDF Forms Flattener might look like this:
PDFFormsFlattener –-input XFADocument.pdf –-output Flattened_output.pdf -–import datafile.xdp
You don’t need to include a path name for any of these files if the input file and profile are stored in the same directory as the program executable, and if you save the output file to the same directory as well.
But you might want to draw an input file from one directory and save the output to another. In that event you need to provide the path as well as the file name:
PDFFormsFlattener –-input C:\Datalogics\InputFiles\XFADocument.pdf –-output C:\Datalogics\FlattenedFiles\Flattened_output.pdf
If any of the file or path names include spaces, use quotes around the name:
PDFFormsFlattener –-input "C:\Datalogics\Optimized Files\XFADocument.pdf" –-output C:\Datalogics\FlattenedFiles\Flattened_output.pdf
The Windows installation program for Forms Flattener adds the location of the PDF Forms Flattener executable to the PATH in the Windows Environment Variables, so you can run the executable, PDFFormsFlattener.exe, from anywhere.