10-1 Execution Method

10-1-1 Command Notation for Command-Line Applications

In this manual, the following notations are used for the Command-line application commands:

Notation

Description

Plain text
(without square brackets ([ ]) or curly braces ({ })

Fields that require entering the string exactly as it is notated.

<Text enclosed in angle brackets>

Fields that require a value. The text is the field name.

[Text enclosed in square brackets]

Optional field. The text is the field name.

{Text enclosed in curly braces}

Required field set. Selecting one from the fields is required.

Vertical bar (|)

A separator for field sets. You must select one option, and you cannot specify multiple options at the same time.

10-1-2 Basics of Execution Methods

Antenna House PDF API Command-line application is executed by specifying arguments using the following configuration.

<Command-line application name> <command> [parameter] -d {input file|folder path} -o {output file|folder path}

The meaning of items:

Example: -changeDocInfo

Example: -title Val

Example: -d C:\test\test.pdf

Example: -o C:\sav\out.pdf

10-1-3 Running on Windows Versions

Run the Windows version of the Command-line application with arguments as follows:

AHPDFToolCmd80.exe <command> [parameter] -d {input file|folder path} -o {output file|folder path}

Note:

  • For commands that require parameters, be sure to specify "parameter" after specifying "command". If "parameter " is not specified, an error will occur.
  • The success or failure of execution and error code can be obtained from the return value obtained using the environment variable "ERRORLEVEL". For details, see "14-3 Error Handling" in this manual.
  • If an error occurs in PdfTk, the internal library of "Antenna House PDF API", during execution, a message text indicating the error content will be output to standard output. For details including error contents, see "14-3 Error Handling" in this manual.

10-1-4 Running on Linux Versions

Run the Linux version of the Command-line application with arguments as follows:

AHPDFToolCmd80 <command> [parameter] -d {input file|directory path} -o {output file|directory path}

Shell Script "run.sh"

In Linux versions, a shell script "run.sh" is placed by the installer. "run.sh" is a shell script that can be executed by setting the location information of command-line applications and license files in environment variables.

Unlike Windows versions, the installer does not set environment variables on Linux versions. Instead, "run.sh" with installation destination information is included. (More precisely, "run.sh" is generated during installation after filling in information such as the deployment folder.)

When using "Antenna House PDF API" through a shell script, specify the arguments and execute it as follows:

sh run.sh [command] [parameter] -d (input file/folder path) -o (output file/folder path)

Once you run the shell script, you can run "AHPDFToolCmd80" on the command-line without setting environment variables until you close the terminal.

Note:

  • For commands that require parameters, be sure to specify "parameter" after specifying "command". If "parameter" is not specified, an error will occur.
  • The success or failure of execution can be obtained from the return value obtained using the variable "$?". For details, see "14-3 Error Handling" in this manual.
  • If an error occurs in PdfTk, the internal library of "Antenna House PDF API", during execution, a message text indicating the error content will be output to standard output. For details including error contents, see "14-3 Error Handling" in this manual.
  • Environment variable settings made by the shell script "run.sh" are retained only until the terminal is closed. If you want to set environment variables that are automatically read at login, such as Windows system environment variables, try setting environment variables for the execution environment using [~/.profile], [~.bashrc], and [~/.bash_profile].