Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

batch printing pdf files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Cho - 19 Mar 2005 02:26 GMT
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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.