Note that there are some explanatory texts on larger screens.

plurals
  1. POExecution of PDFTk from PHP script is failing with error code 11
    primarykey
    data
    text
    <p>I am trying to Fill in a PDF from PHP script. I am following the article by <strong>Sid Steward</strong> at the following <a href="http://www.mactech.com/articles/mactech/Vol.20/20.11/FillOnlinePDFFormsUsingHTML/index.html" rel="nofollow noreferrer">URL</a>.</p> <p>I have configured <strong>PDFTk</strong> package on <strong>CentOS</strong> linux distribution and I am able to execute the pdftk from the command prompt and it merges the FDF form with the PDF and successfully generates the flattened(Filled) PDF. I am using following command to test the Pdftk using shell.</p> <pre><code>pdftk /tmp/form.pdf fill_form /tmp/fdfbm0pe7 output /tmp/filledform.pdf flatten </code></pre> <p>But When try to execute a similar command through PHP, I am getting the error. The <strong>passthru</strong> command is failing with error code <strong>11</strong>. Following is the php code I am using to execute the command:</p> <pre><code>$command = 'pdftk form.pdf fill_form '. $fdf_fn. ' output - flatten'; passthru($command, $error); </code></pre> <p>The <strong>$fdf_fn</strong> above has the FDF file name. The <strong>form.pdf</strong> is the fill-able pdf form. Both the <strong>form.pdf</strong> and the PHP script file from which I have given the above lines of code are in the same folder. I have checked that PDFtk is executing correctly through PHP by echoing <strong>shell_exec('pdftk')</strong> and it was returning the standard help details.</p> <p>Just to provide more details, the path to pdftk is <strong>/usr/bin/</strong> and PHP script and PDF form files are located under <strong>/var/www/html/pdfmerge</strong>.</p> <p>Can some one please guide what I am doing wrong that the command execution through PHP is failing with error code 11?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload