This is most likely not an easy one but here is the situation:
I have written a C# command line application which:
- creates a PDF using ITextSharp
- writes it to disk
- uses
Acrord32.exe
(this is Acrobat Reader) viaSystem.Diagnostics.Process
in order to silently print the generated PDF
If I build my solution and double click the pdfGen.exe
, it works as expected. The PDF is created and printed.
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 shell_exec()
so that the resulting PDF will be printed on the printer attached to the server.
So my PHP page looks basically like this:
shell_exec('/path/to/pdfGen.exe');
But here things go wrong. What happens is according to task manager etc.:
pdfGen.exe
starts- the PDF is created
Acrord32.exe
startspdfGen.exe
hangs forever (and so does the PHP script) and nothing is printed
I am pretty sure it is some permission related problem. I already gave IIS_IUSRS
access to the default printer, and to the directory where Acrord32.exe
is located. But still, no printing. However, if I start my pdfGen.exe manually it works.
Any idea what I am missing?
EDIT:
I am not bound to use Acrobat Reader in order to print the PDF. If there is another way in order to silently print the created PDF serverside, I would not mind at all.