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:

C:\Datalogics\APDFL18.0.0PlusP1b\Java\Sample_Source\target\command-line\bin

You should already be in this folder:

C:\Datalogics\APDFL18.0.0PlusP1b\Java\Sample_Source

From this directory type this statement:

target\command-line\bin

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:

AddTextToDocument

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