SetJob()
Something like this:
Code: Select all
SetJob_(hPrinter, iJobId, 0, #Null, #JOB_CONTROL_DELETE)
Code: Select all
SetJob_(hPrinter, iJobId, 0, #Null, #JOB_CONTROL_DELETE)
Hi yrreti. Once the job is no longer in the OS's print spooler queue, the only available action would be to cancel it physically from the printer's control panel, or on some models, the software control panel.yrreti wrote:...after it is sent to the printer, and I realize that I made a mistake in the info I was printing, is there a way to cancel the print job...?
...because it's running from the printers memory at that point.
That must be a set-up thing (which is a pity as you probably would not be able to control the settings on a customer's PC).Once the job is no longer in the OS's print spooler queue
Code: Select all
PH=Print_GetPrinterHandle()
If AbortPrinter_(PH)
Debug "AbortPrinter ok"
EndIf
Hi IdeasVacuum. The OS's print spooler will display the print jobs in queue until it has been completely sent to the printer; not until the printing has completed. Many printers have built-in memory which receive and store the print jobs, freeing up the OS's spooler. Print jobs sent to my Brother MFC-7840N (32MB), and Fuji-Xerox CM215FW (128MB), get cleared from the OS's print queue almost instantly, sometimes even before a single page gets printed. Your system displays the print progress synchronously with the physical printout perhaps because your printer is not equipped with such memory.IdeasVacuum wrote:That must be a set-up thing (which is a pity as you probably would not be able to control the settings on a customer's PC).
On my PC, the print queue displays the current print job until the printing is completed and so you can halt printing during the process. If you are printing 50 sheets and then stop the process, it will continue printing the current sheet but then no more. I imagine this is what you would like to be able to do from your app.
You'd think that, but you'd be surprised. Because they don't.IdeasVacuum wrote:...there will be a regular call-back to the OS to allow it to send an abort instruction. I can't imagine any printer manufacturer not providing this essential facility.
AbortPrinter function
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
If the printer is not configured for spooling, the AbortPrinter function has no effect.
Well, that's where I thought SetJob() would be usedWhat to use when Spooling isn't configured?
Code: Select all
SetJob_(hPrinter, iJobId, 0, #Null, #JOB_CONTROL_DELETE)
Code: Select all
SetJob_(hPrinter, iJobId, 0, #Null, #JOB_CONTROL_DELETE
Code: Select all
PH=Print_GetPrinterHandle()
If AbortPrinter_(PH)
Debug "AbortPrinter ok"
EndIf
You're right about that, but such printers usually come with their own software monitors that are equipped to purge jobs from their memories. But since such hardware features are non-standard, OSes usually aren't able to initiate them.IdeasVacuum wrote:... larger capacity printers could be on a completely separate floor in the building, so the on-device facility would not be appropriate.