How to use WhiteFramework in C# to automate Print Jobs?

Aug 8, 2011 at 8:43 AM

Hi all,
 
I am developing a console application using C# to automate Print Job for a bulk of documents. Below I am mentioning my plan for developing and my approach.
 
Algorithm:
 
1)Fetch list of documents.
2)Process the document list one by one.
      a)Launch the Application.
      b)Wait till the application launched perfectly.
      c)Fire the Print Job.
      d)Wait for Print dialog appear.
      e)Fire "ENTER" key press event.
      f)Wait till spooling finish.
      g)Close the document and application.
3)Update the XML with Print job info.
 

Code:

//Launch the file from the location specified in.
White.Core.Application application =White.Core.Application.Launch(@path);
 
Console.WriteLine("launch is done");
 
Thread.Sleep(3000);//Wait till Application Launched successfully ?
 
//Sending Commands to Print(to press "Ctrl+P" button).
SendKeys.SendWait("^(p)");
 
Thread.Sleep(3000);//Wait till Print Dialog appear ?
 
//Sending Commands to Print(to press "Enter" Button).
SendKeys.SendWait("{ENTER}");
 
//Get the current time as the document fired for print job.
_printedTime = DateTime.Now;
 
Thread.Sleep(3000);//Wait till spooling Finish ?.
 
//Closing the window.
SendKeys.SendWait("%{F4}");

 
Now the problem is for waiting case I am blindly using Thread.Sleep(With Few seconds), which is not Ideal. So I need to know How I'll fix these issues using White Framework in C#.
 
Can anybody help me to fix this issue please. Any help will be appreciated.
Thanks in advance

Coordinator
Aug 19, 2011 at 12:33 PM

http://white.codeplex.com/wikipage?title=Wait%20Handling&referringTitle=Home

Sep 14, 2011 at 6:23 AM

Hi Vivek,

Can you please send me the link for download "Core.dll"