mikehaertl\pdftk\Pdf::__construct PHP Method

__construct() public method

public __construct ( string | Pdf | array $pdf = null, array $options = [] )
$pdf string | Pdf | array a pdf filename or Pdf instance or an array of filenames/instances indexed by a handle. The array values can also be arrays of the form array($filename, $password) if some files are password protected.
$options array Options to pass to set on the Command instance, e.g. the pdftk binary path
    public function __construct($pdf = null, $options = array())
    {
        $command = $this->getCommand();
        if ($options !== array()) {
            $command->setOptions($options);
        }
        if (is_string($pdf) || $pdf instanceof Pdf) {
            $this->addFile($pdf);
        } elseif (is_array($pdf)) {
            foreach ($pdf as $handle => $file) {
                if (is_array($file)) {
                    $this->addFile($file[0], $handle, $file[1]);
                } else {
                    $this->addFile($file, $handle);
                }
            }
        }
    }