0

I am trying to print 4 PDF or 4 Jpeg with my C# code, but i have a very importart problem. Here is my code for the print of PDFs :

for (int pdfcount = 1; pdfcount < 5; pdfcount++)
{
  filename = "Doc" + pdfcount + ".pdf";
  ProcessStartInfo psInfo = new ProcessStartInfo();
  psInfo.FileName = @"C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe";
  psInfo.Arguments = String.Format("/n /s /o /h /p{0}", filename);
  psInfo.CreateNoWindow = true;
  psInfo.UseShellExecute = true;
  psInfo.WindowStyle = ProcessWindowStyle.Hidden;
  Process process = Process.Start(psInfo);
}

So it works but i have a problem with the priority. I send for printing the Doc1.pdf,Doc2,Doc3 and Doc4.pdf with this order but my printer printing them mixed. For example it prints first the Doc3 after that the Doc2...etc. How i could make my queue of printer to be fixed?

NickName
  • 313
  • 2
  • 9
  • 25

1 Answers1

0

Documents will be queued up to print based on whichever document is spooled to the print queue first. So generally the smaller documents to spool faster and therefore get into the queue first.

I would suggest that you find a way to confirm that Acrobat Reader has finished spooling the document before proceeding to open and print the next one. Probably by waiting for the process to quit before starting the next.

S.Richmond
  • 11,412
  • 6
  • 39
  • 57
  • The reason that i print 4 pdfs it's because i had one pdf which has 4 pages but it was printed very slow. So i though that if i use 4 Pdf it will be more quickly. I will try with your suggestion but i don't know if i will success with the duration of the printing. Thx for your response – NickName May 16 '14 at 06:28
  • When the printer receives your PDF it must then process the PDF into a format it can print with. Most printers have around 100Mhz CPUs and can take more than a few minutes to parse the PDFs, based on their complexity. The only way you can speed this up is to convert the PDF into a format it can more easily process, such as an image, and send that for printing. – S.Richmond May 16 '14 at 15:12
  • I had convert the pdf to jpeg but i can't print it in A4 sheet like PDF. Look my question if you could help me : http://stackoverflow.com/questions/23675833/print-a-jpeg-in-sheet-a4-in-same-size-like-pdf-without-any-zoom – NickName May 16 '14 at 15:26