Thank you for all your work @Gmin2! I really appreciate the way this crate interacts easily with the local CUPS system. Makes life a lot easier if you don't have to do IPP coding directly.
During the integration in my current project I have found a few things I will need to work on. Maybe its something I could add to this crate as a PR:
- querying the printer for available input slots
- easy way to specify the input slot to use when submitting a job
- should we still use the job option
media or should we use PageSize when creating a print job? I have found lots of information on both but I am not sure if media is outdated with CUPS v2.
- the crate allows for easy media query from the printer, however, they are only returned in inches, maybe allow for a conversion to pt and mm
- easy way to specify margins for print jobs, currently it requires
custom_option
- allow to override the requesting user. Right now the currently logged in user is used as the owner of the print job, however, in a Kiosk setup different users might sign into the app and the print job should reflect that.
- somehow build an async wrapper. As everything with CUPS printing can take a long time from start to finish one needs to be mindful when using the crate in an asynchronous environment (as you also clearly mention in the README.MD). From what I can see - so far - is, that only a single operation should be performed with the CUPS API at any given time. So maybe a global
mutex could provide enough guarding for the entire crate. I will look more into that or maybe you have already experience with this.
- optimizing the
get_job_info operation, as right now it pulls all jobs from the server and iterates over them. This could become an issue with a large job history. But I am not sure CUPS offers a simpler way to do that.
Please feel free to chime in on those first observations.
Thank you for all your work @Gmin2! I really appreciate the way this crate interacts easily with the local CUPS system. Makes life a lot easier if you don't have to do IPP coding directly.
During the integration in my current project I have found a few things I will need to work on. Maybe its something I could add to this crate as a PR:
mediaor should we usePageSizewhen creating a print job? I have found lots of information on both but I am not sure ifmediais outdated with CUPS v2.custom_optionmutexcould provide enough guarding for the entire crate. I will look more into that or maybe you have already experience with this.get_job_infooperation, as right now it pulls all jobs from the server and iterates over them. This could become an issue with a large job history. But I am not sure CUPS offers a simpler way to do that.Please feel free to chime in on those first observations.