Note that there are some explanatory texts on larger screens.

plurals
  1. POStarting serverside print job via PHP
    text
    copied!<p>This is most likely not an easy one but here is the situation:</p> <p>I have written a C# command line application which:</p> <ul> <li>creates a PDF using ITextSharp</li> <li>writes it to disk</li> <li>uses <code>Acrord32.exe</code> (this is Acrobat Reader) via <code>System.Diagnostics.Process</code> in order to silently print the generated PDF</li> </ul> <p>If I build my solution and double click the <code>pdfGen.exe</code>, it works as expected. The PDF is created and printed.</p> <p>Now, my app has to be deployed on a internal server with Windows Vista running IIS 7. This server has some PHP webapp running. And it will be called via PHP using <code>shell_exec()</code> so that the resulting PDF will be printed on the printer attached to the server.</p> <p>So my PHP page looks basically like this:</p> <pre><code>shell_exec('/path/to/pdfGen.exe'); </code></pre> <p>But here things go wrong. What happens is according to task manager etc.:</p> <ul> <li><code>pdfGen.exe</code> starts</li> <li>the PDF is created</li> <li><code>Acrord32.exe</code> starts</li> <li><code>pdfGen.exe</code> hangs forever (and so does the PHP script) and nothing is printed</li> </ul> <p>I am pretty sure it is some <em>permission related problem</em>. I already gave <code>IIS_IUSRS</code> access to the default printer, and to the directory where <code>Acrord32.exe</code> is located. But still, no printing. However, if I start my pdfGen.exe manually it works. </p> <p>Any idea what I am missing? </p> <p>EDIT:</p> <p>I am not bound to use Acrobat Reader in order to print the PDF. If there is another way in order to <em>silently</em> print the created PDF serverside, I would not mind at all.</p>
 

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