Running your Java sample programs from a command line

When you build the Maven package the process creates a set of scripts, one script for each Java sample program in the Adobe PDF Library, and it names each script after the corresponding sample program file. For Windows each script is a batch file (.bat), while for Unix the build process creates a set of Bash scripts.

To run a Java sample, simply type the name of that sample program in a command line. It will look like you are running an executable, but you are in fact running the script that calls the sample program. The scripts are stored in this directory:


You should already be in this folder:


From this directory type this statement:


And then the name of the sample program.

For example, if you want to run the sample program AddTextToDocument, your command line statement would look like this:


Enter arguments for a sample program as parameters on the command line. For example, for the sample, you can enter the file name of your own PDF input document as a command line parameter.