PC Review


Reply
Thread Tools Rate Thread

batch printing pdf files

 
 
David Cho
Guest
Posts: n/a
 
      19th Mar 2005


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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
QWERTY
Guest
Posts: n/a
 
      19th Mar 2005
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";
> command.StartInfo.Arguments = "/p /h " + pdfFileName;
> command.StartInfo.RedirectStandardOutput = true;
> command.StartInfo.UseShellExecute = false;
> command.Start();
> command.StandardOutput.ReadToEnd();

command.WaitForExit();



On Fri, 18 Mar 2005 17:26:27 -0800, David Cho <(E-Mail Removed)>
wrote:

>
>
>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.
>
>*** Sent via Developersdex http://www.developersdex.com ***
>Don't just participate in USENET...get rewarded for it!


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch printing of excel files =?Utf-8?B?R3Jk?= Microsoft Excel Programming 1 20th Oct 2005 07:52 PM
Printing HTML Files in Batch =?Utf-8?B?bmF3d3U=?= Microsoft Dot NET 0 16th Sep 2004 03:23 PM
Batch printing files for user out of VBA Fly Girl Microsoft Windows 2000 Terminal Server Clients 0 26th Jan 2004 10:28 PM
How do I name files when batch printing to a PDF writer? M Skabialka Microsoft Access Reports 6 20th Oct 2003 11:36 PM
Printing HTML Files in Batch Mode Doctor B. Windows XP Internet Explorer 0 9th Jul 2003 07:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:22 PM.