-
Notifications
You must be signed in to change notification settings - Fork 202
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 AirPrint and Mopria Compatibility #126
Conversation
…ia sizes and lookup the (smaller) list of ready sizes.
Don't include application/octet-stream in pdl value.
…slot Renamed the default for "--with-cups-control-slot" from "admin" to "cups-control".
If the client Snap is the same as our cupsd is snapped in, grant access without calling "snapctl". This makes the checks faster and less resource-consuming if the inquiries are from the command line tools or the included cups-browsed.
For me everything makes sense and as you have tested with appropriate clients it seems all to work. Now I have some doubts, but it can be that it is due to restrictions on current CUPS and PPD-file-based print queues. When I poll the IPP attributes of my HP OfficeJet Pro 8730 with
"CP1" probably means "1 copy" and this means that for multiple copies in URF the page has to get sent repeatedly? What is what a CUPS queue is capable of here? It seems that you do not add this item. "MT1-2-8-9-10-11" probably means "MediaType" and AFAIR PAPPL adds it but you do not add it in CUPS. Can it not be derived from the PPD's "MediaType" option? "PQ3-4-5": You simply add all theree quality levels. Is there no way to determine from the PPD which levels are actually available? "RS300-600" means that the printer can take URF in 300dpi or 600dpi. Probably CUPS can take URF as input in all the physical printer's resolutions. Your code only adds "RS" expressions with a single value. "OB10" OutputBin? My printer has only one, what does it exactly mean? Could it be derived from the "outputBin" option of the PPD? "IS1-2" Probably "InputSlot". My printer has two trays, named "Tray 1" and "Tray 2". Could this also be taken from the PPD? "FN3" Finishers? My printer has no finishers. Ar for all these entries equivalen options/drop-downs shown in the print dialog of an iOS device (I have no device to try out)? Another point is MediaReady. First, I assume that CUPS has nowhere something like "loaded media" as PPDs do not support this, whereas Printer Applications based on PAPPL have "loaded media" and so provide true media-ready information. So it is principally a good idea to list only the most common sizes based on the default size (A4 or Letter) and from these common sizes only show actually supported sizes. Also makes sense to only show the default size if it is neither A4 or Letter, as these are often specialty printers which can only hold one paper size at a time anyway (and this one one simply sets as default). And if it does not work out for some users one can set it in Once, did you tell in the man pages and Also, if the printer behind a CUPS queue is an IPP printer ( These are only some ideas (of someone who has no iOS device), if they do not really give any improvement for iOS or Mopria client users, simply do the URF/Mopria support as you are doing it currently. |
@tillkamppeter WRT the URF values:
I should add CP1 (and yes it means per-page copies support, so definitely 1 to force the client to generate copies for URF)
It could, but always mirrors the "media-type" value in the job ticket for iOS, macOS, and Mopria clients (or 0 is passed for "default").
I can check the cupsPrintQuality option, but like MT you'll never have per-page print quality settings - it's a holdover for a theoretical non-IPP print path (USB before IPP-USB).
Right, because a) URF is a fallback path since PDF is supported, and b) spooling huge raster files is inefficient - most printers stream raster data to avoid hitting the disk/SSD but cupsd doesn't support that.
Yes, however you don't see it embedded in the raster file.
Yes, and yes. But since we aren't advertising media-ready/media-col-ready values tied to specific InputSlot (media-source) values it won't be used by iOS clients. macOS and Mopria clients use media-source-supported anyways.
Yes, IPP finishings enum values. Might be worthwhile to include for iOS for the common ones we can detect, but otherwise clients will exclusively use finishings-supported/finishings-col-supported (which we do report).
iOS provides options for copies (independent of the CP value), duplex, color, staple, and media size/type/source (from media-col-ready).
Correct.
That's what the current code does - cupsd.conf provides a default set of sizes, and we list the matching sizes from the PPD or the default size if none of the sizes match.
The examples use the PPD size names. I can add a comment to make that explicit (for ReadyPaperSizes and DefaultPaperSize).
No, because a) the value will become out of date quickly and b) that printer is probably accessible directly. This is intended to support AirPrint sharing of legacy or access-limited printers in a controlled environment (think the office copier that only has A4 and A3 loaded in it). Thanks for the feedback, I'll make the documentation, FN, and CP changes and merge. |
this adds a missing translation
I have done a quick test now by building the CUPSSnap with the apmo branch of CUPS. The Snap works so far, but if I poll the attributes of a CUPS queue withh On my Pixel 5 (Android 11) I have installed the Mopria app. In the app I only see my printer directly and also some queues of the PostScript Printer Application, but no entry for the queues of the CUPS Snap, probably caused by the missing "mopria" entry. Printer sharing is turned on according to |
Hmm, I didn't update the cache file version so maybe you are still using old cached data? Also, "mopria-certified" isn't a default ("all" group) attribute - need to add that and some AirPrint-specific attributes to the ipp-support list... |
What is strange for me is that Mopria does not show the printers. |
- Add mopria-certified and printer-wifi-xxx to list of Printer Description attributes. - Bump the PPD cache version to reflect the additional attributes we are adding. - Update the documentation to note that DefaultPaperSize and ReadyPaperSizes contain a list of PPD size names. - Update urf-supported/URF values to include copies (CP), finishings (FN), and print-quality (PQ) values.
Solved it, as the printer was auto-created by cups-browsed it was not shared. I have set it shared via the web interface now and now it appears in both |
@tillkamppeter Please re-test from the latest apmo branch code... [apmo 954d47c] Address review by Till Kamppeter: |
Mopria app does not show ready media, but it prints the test page. |
Done! |
Thank you very much, it is now already on the way into the Snap Store. The first time the CUPS Snap has no patches at all! |
This pull request adds complete AirPrint and Mopria compatibility to the default configuration of CUPS. Key functionality is:
ReadyPaperSizes
directive that specifies the "loaded" (ready) media for each printer; the actual list is based on the supported media sizes for the printer, and allows the user to pick a size from a short list. Default list is based on locale (A4, etc. everywhere but North America which uses Letter, etc.)The AirPrint functionality was tested from an iPhone Xs and iPad Pro. Ready media correctly lists the set of configured sizes that are supported by the printer. The Mopria functionality was tested from a Windows 10 laptop.
This PR also fixes localization of media-source/InputSlot. See the linked issues for details.