There isn't, as far are I know, you'd need to either keep the printer busy by keeping the job open and sending PJL or other commands that don't eject a page. The other option is to concatenate your jobs together into one large job. I guess you could also programatically pause the shared print queue and send the data directly using a direct IP print port or something. In the end there isn't an elegant solution to this.
Print multiple jobs without interruption c#
-
07-07-2023 - |
Question
Is there a way to print multiple jobs in a row, without letting another user send a print job in between? (sort of "don't give the token to another user as long as my print jobs haven't finished")
It's a shared printer and many users have access to it, and what I'm printig is a big document so it takes some time; I'm using more then one job because its pages are not to be printed from the same paper tray, so I have to switch the paper source in my code.
Help please! and thanks in advance.
P.S. I'm using the PrintDocument object of .Net
Solution 2
OTHER TIPS
Instead of using multiple jobs, I can just change the settings for each page when printing (modify the PrintPageEventHandler), here's a link, and a sample of my code:
private void PrintPage(object sender, PrintPageEventArgs ev) { using (Metafile pageImage = new Metafile(streamList[currentPageIndex])) { // If it's the first page if (currentPageIndex == 0) { // Use a certain tray ev.PageSettings.PaperSource = PaperTrayPage1; } // For the rest of the document else { // Use another tray ev.PageSettings.PaperSource = PaperTrayRest; } currentPageIndex++; ev.Graphics.DrawImage(pageImage, ev.PageBounds); ev.HasMorePages = (currentPageIndex < streamList.Count); } }
Combining multiple jobs (PrintDocument objects) is possible, here's an example.