Description of problem: To set the default media size for a queue, the correct way to do it is with a CUPS-Add-Printer IPP request, including a "media" attribute. That is how lpadmin implements this command: lpadmin -p printer -o media=iso_a4 However, the cups-pk-helper implementation of addPrinter has no allowance for arbitrary attributes, making this problematic. For setting the page size, the closest we can get is to modify the PPD's PageSize attribute and use that file with PrinterAddWithPpdFile... however, it means we have to fetch the PPD first, so it's a bit ugly. My recommendation: add a method PrinterSetSettings with in_signature "sass" which would do this: num_options = cupsParseOptions (opts, num_options, &options); req = ippNewRequest(CUPS_ADD_MODIFY_PRINTER); /* or _CLASS, as needed */ ippAddString (..., "printer-uri", ..., uri); ippAddString (..., "requesting-user-name", ...); cupsEncodeOptions2 (req, num_options, options, IPP_TAG_PRINTER); req = cupsDoRequest (..., request, "/admin/"); i.e. it would perform a CUPS-Add-Printer request with just options. Version-Release number of selected component (if applicable): cups-pk-helper-0.1.3-2.fc16.x86_64
Hi, I implemented the new method as described in comment #1 but it doesn't change the PPD file. I've looked into source code of the lpadmin and I see that it catches the PPD, change it and send it back to CUPS (if the PPD is available). Or am I wrong? Marek
(In reply to comment #1) > I implemented the new method as described in comment #1 but it doesn't change I meant description, not comment #1.
Oh, yes, I see. I hadn't spotted that part... In a future release of CUPS there will be no support for PPDs in any case, only IPP attributes. Until then, I guess cups-pk-helper will have to do the same thing: read in the PPD, call ppdMarkDefaults() and cupsMarkOptions(), and write that file out again. As cups-pk-helper doesn't need to support changing the cupsIPPSupplies/cupsSNMPSupplies attributes, it can be simplified a bit, only adjusting *Default[...] attributes, and special-casing for PageRegion/PaperDimension/ImageableArea. Want me to send you a patch to do that?
Hi Tim, thank you for your offer. I'll prepare the patch myself. Regards Marek
Created attachment 556061 [details] Add method PrinterSetSettings Here is an implementation of the method in cups-pk-helper. But I think now that since we already need to parse the PPD for "*Default" entries we should just modify the method "PrinterAddOptionDefault" to do that. This would be compatible with current version and we can add the new method to the next release. What do you think Tim? Marek
Doesn't PrinterAddOptionDefault append "-default" to the provided option names? You must be sure to set "media" (which changes the PPD file) and not "media-default" (which does not).
New method PrinterAddOption, which fixes this bug, was added in 0.2.2 release of cups-pk-helper. Since we are after beta change deadline, I'm proposing this bug as a nice-to-have bug for F17 (rebase of cups-pk-helper to 0.2.2). Marek
(In reply to comment #7) > Since we are after beta change deadline, I'm proposing this bug as a > nice-to-have bug for F17 (rebase of cups-pk-helper to 0.2.2). > > Marek Hi, if you want to have this included in F17 Beta, you need to propose it as F17Beta-accepted. F17-accepted is for the final release, and by that time you probably manage to push the update into stable repos.
(In reply to comment #8) > (In reply to comment #7) > > Since we are after beta change deadline, I'm proposing this bug as a > > nice-to-have bug for F17 (rebase of cups-pk-helper to 0.2.2). > > > > Marek > > Hi, if you want to have this included in F17 Beta, you need to propose it as > F17Beta-accepted. F17-accepted is for the final release, and by that time you > probably manage to push the update into stable repos. OK, I'll try to get it into beta.
cups-pk-helper-0.2.2-1.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/cups-pk-helper-0.2.2-1.fc17
Discussed at 2012-03-28 go/no-go meeting, acting as an NTH review meeting. Rejected as NTH: we can't see any reason this needs to make the beta images, it will be fine going out as an update. People don't often print from the installer or from a Beta live image. -- Fedora Bugzappers volunteer triage team https://fedoraproject.org/wiki/BugZappers
cups-pk-helper-0.2.2-1.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.