title: pdftk not executing in php
body: <p>I can't execute pdftk in php. As in documentation, it is just mentioned as follow to saveas.</p>
  <pre><code>use mikehaertl\pdftk\Pdf;
  
  $pdf = new Pdf('/path/my.pdf');
  
  $pdf-&gt;allow('AllFeatures')      // Change permissions
      -&gt;compress($value)          // Compress/Uncompress
      -&gt;saveAs('new.pdf');
  </code></pre>
  <p>But my code doesn't give any output. I try to debug like</p>
  <pre><code>// Check for errors
  if (!$pdf-&gt;saveAs('new.pdf')) {
      $error = $pdf-&gt;getError();
  }
  </code></pre>
  <p>No message.
  Later I found, Pdftk hasn't been executed</p>
  <pre><code>public function saveAs($name)
  {
      if (!$this-&gt;getCommand()-&gt;getExecuted() &amp;&amp; !$this-&gt;execute()) {
       echo 'test'; // it is printing   
       return false;
      }
  }
  </code></pre>
  <p>What does it mean ? I have installed from composer. When reading github issue, developer's reply likely my problem. is
  <strong>You need to set the path to your pdftk command, see <a href="https://github.com/mikehaertl/php-pdftk#execution" rel="nofollow noreferrer">https://github.com/mikehaertl/php-pdftk#execution</a></strong></p>
  <p>I can't clear about how to set path, it is not highlighted in documentation. Only mentioned here</p>
  <p>The class uses php-shellcommand to execute pdftk. You can pass $options for its Command class as second argument to the constructor: As example.</p>
  <pre><code>$pdf = new Pdf('/path/my.pdf', [
      'command' =&gt; '/some/other/path/to/pdftk',
      // or on most Windows systems:
      // 'command' =&gt; 'C:\Program Files (x86)\PDFtk\bin\pdftk.exe',
      'useExec' =&gt; true,  // May help on Windows systems if execution fails
  ]);
  </code></pre>
  <p>I am using xampp. Regarding pdftk, I have a directory within project which was created from composer. phpand what is this path ? this project can be moved in linux or window server ? Do I need any third party software installation for this ?</p>