I loop through the code that looks like this to batch a set of pdf
files.
Process command = new Process();
command.StartInfo.FileName = "AcroRd32.exe";
command.StartInfo.Arguments = "/p /h " + pdfFileName;
command.StartInfo.RedirectStandardOutput = true;
command.StartInfo.UseShellExecute = false;
command.Start();
The problem is, the order in which the documents are printed is very
important. But it seems like Acrobat Reader and the printer scramble
the order.
Here is a very strange thing. Right after command.Start(), I tried
command.StandardOutput.ReadToEnd();
It USED TO WORK. And then out of the blue, it prints the document and
just hangs until I kill Acrobat Reader.
Adding
Thread.Sleep(10000);
Will make the order right, but only to a degree. The order is just less
scrambled, which is not good enough.
So please help.
QWERTY - 19 Mar 2005 15:01 GMT
You will need to wait for each process to finish before starting a new
priting process.
I would make the following changes
> Process command = new Process();
> command.StartInfo.FileName = "AcroRd32.exe";
[quoted text clipped - 3 lines]
> command.Start();
> command.StandardOutput.ReadToEnd();
command.WaitForExit();
>I loop through the code that looks like this to batch a set of pdf
>files.
[quoted text clipped - 28 lines]
>*** Sent via Developersdex http://www.developersdex.com ***
>Don't just participate in USENET...get rewarded for it!
codezilla94 - 12 Mar 2008 05:11 GMT
Here is a Windows Service that will kill your run away AcroRd32.exe processes
(or any other processes for that matter) after a configurable amount of time
http://www.spikesolutions.net/ViewSolution.aspx?ID=d288b399-24e0-4942-8ac4-2f78e
da45469
>I loop through the code that looks like this to batch a set of pdf
>files.
[quoted text clipped - 25 lines]
>
>So please help.