qzind / tray

Browser plugin for sending documents and raw commands to a printer or attached device.
https://qz.io
Other
824 stars 266 forks source link

Add ability to clear a printer's queue #1185

Closed tresf closed 8 months ago

tresf commented 9 months ago

Request to add the ability to clear a print queue. It should be assumed that a person can only clear their own jobs.

We [...] had an issue related to the OS spooler caused by sending a bad ESC command to Star printers. Despite immediately correcting the change, we had no way to clear the queue and had to manually clear it on every device which had a huge impact on customers and our support team. Our primary objective is to avoid this havoc in the future.

Windows:

MacOS/Linux:

Vzor- commented 9 months ago

IPP has Cancel-Job operation that will probably work. There is also a Purge-Jobs operation, but that also clears out the completed jobs, not just pending.

Vzor- commented 8 months ago

I was able to implement this for cups https://github.com/Vzor-/tray/tree/cancel-jobs. Implementing it for windows will likely be a little bit harder. We need the setJob method, but it is not part of JNA's Winspooler class, so we will likely have to add it ourself.

Vzor- commented 8 months ago

We need the setJob method, but it is not part of JNA's Winspooler class, so we will likely have to add it ourself.

This is now working, also it will be included in the next version of JNA's Winspooler https://github.com/java-native-access/jna/pull/1556