Property | Type | Description | |
---|---|---|---|
$_command | the pdftk binary | ||
$_escapeOperationArgument | whether to force escaping of the operation argument e.g. for filenames | ||
$_files | list of input files to process as array('name' => $filename, 'password' => $pw) indexed by handle | ||
$_operation | the operation to perform | ||
$_operationArgument | operation arguments, e.g. a list of page ranges or a filename or tmp file instance | ||
$_options | list of command options, either strings or array with arguments to addArg() |
Method | Description | |
---|---|---|
addFile ( string $name, string $handle, string | null $password = null ) : |
||
addOption ( string $option, string | File | null $argument = null, $escape = null ) : |
||
addPageRange ( integer | string | array $start, integer | string | null $end = null, string | null $handle = null, string | null $qualifier = null, string $rotation = null ) : |
Add a page range as used by some operations | |
execute ( string | null $filename = null ) : boolean | ||
getFileCount ( ) : integer | ||
getOperation ( ) : string | null | ||
getOperationArgument ( ) : string | array | null | ||
setOperation ( string $operation ) : |
||
setOperationArgument ( string $value, boolean $escape = false ) : |
Method | Description | |
---|---|---|
checkExecutionStatus ( ) | Ensure that the command was not exectued yet. Throws exception otherwise. | |
processInputFiles ( ) | Process input PDF files and create respective command arguments | |
processOperation ( ) | Process opearation and create respective command arguments | |
processOptions ( string | null $filename = null ) | Process options and create respective command arguments |
public addFile ( string $name, string $handle, string | null $password = null ) : |
||
$name | string | the PDF file to add for processing |
$handle | string | one or more uppercase letters A..Z to reference this file later. |
$password | string | null | the owner (or user) password if any |
return | the command instance for method chaining |
public addPageRange ( integer | string | array $start, integer | string | null $end = null, string | null $handle = null, string | null $qualifier = null, string $rotation = null ) : |
||
$start | integer | string | array | the start page number or an array of page numbers. If an array, the other arguments will be ignored. $start can also be bigger than $end for pages in reverse order. |
$end | integer | string | null | the end page number or null for single page (or list if $start is an array) |
$handle | string | null | the handle of the file to use. Can be null if only a single file was added. |
$qualifier | string | null | the page number qualifier, either 'even' or 'odd' or null for none |
$rotation | string | the rotation to apply to the pages. |
return | the command instance for method chaining |
protected checkExecutionStatus ( ) |
public getFileCount ( ) : integer | ||
return | integer | the number of files added to the command |
public getOperation ( ) : string | null | ||
return | string | null | the current operation or null if none set |
protected processInputFiles ( ) |
protected processOperation ( ) |
protected processOptions ( string | null $filename = null ) | ||
$filename | string | null | if provided an 'output' option will be added |
public setOperation ( string $operation ) : |
||
$operation | string | the operation to perform |
return | the command instance for method chaining |
public setOperationArgument ( string $value, boolean $escape = false ) : |
||
$value | string | the operation argument |
$escape | boolean | whether to escape the operation argument |
return | the command instance for method chaining |
protected $_escapeOperationArgument |
protected $_files |
protected $_operationArgument |