Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to clear a printer's queue #1185

Closed
tresf opened this issue Oct 4, 2023 · 3 comments · Fixed by #1191
Closed

Add ability to clear a printer's queue #1185

tresf opened this issue Oct 4, 2023 · 3 comments · Fixed by #1191
Assignees
Milestone

Comments

@tresf
Copy link
Contributor

tresf commented Oct 4, 2023

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:

  • Perhaps using JOB_CONTROL_DELETE on SetJob.

MacOS/Linux:

  • TBD... Perhaps an API that calls CANCEL on the print job?
@tresf tresf added this to the 2.2.4 milestone Oct 4, 2023
@Vzor-
Copy link
Contributor

Vzor- commented Oct 8, 2023

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-
Copy link
Contributor

Vzor- commented Oct 12, 2023

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- Vzor- mentioned this issue Oct 16, 2023
1 task
@Vzor-
Copy link
Contributor

Vzor- commented Oct 24, 2023

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 java-native-access/jna#1556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants