First feedback - discussion thread #6
Replies: 2 comments 2 replies
-
|
@ronnybremer thanks a lot for observations and suggestions! @ronnybremer "media" is the curremt way to go, "PageSize" is from the deprecated PPD files, and as PPD files will go away in CUPS 3.x, "PageSize" will go away, too. @mintu, for the units you should support all units which CUPS supports. Most importantly, PWG is using 1/100 mm, PostScript uses 1/72 inch (aka "pt" or "points"), mm and cm should also be supported. As you are creating CUPS bindings here, you should use what the original libcups functions output and also provide libcups' APIs for unit conversion or for telling in which unit a function should do its output. @ronnybremer To get margins, see appropriate IPP attributes. all IPP attributes can be polled from the printer. To set margins you create a "media-col", an IPP data structure containing the 2 size dimensions and 4 margins for the page. @Gmin2 the CUPS API has functionality to set the user for an inquiry to CUPS, you should make this API also available in your Rust bindings. @Gmin2 I do not really remember now whether libcups has also async API functions, but generally offering such functions to Rust developers by having them in this crate would be very useful. Generally, for Rust programmers who want to get printing-related functionality into their apps the way to go is:
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions