OpenPrinting / libppd

Apache License 2.0
2 stars 16 forks source link

ppd-generator.c: Check for `urf-supported` if we found `image/urf` #39

Closed zdohnal closed 9 months ago

zdohnal commented 9 months ago

Some devices has AirPrint disabled by default/admins has disabled it, but the device reports image/urf in document-format-supported, but provides no urf-supported attribute, which breaks PPD generation.

We should check for urf-supported once we found image/urf, so in case the device is missing urf-supported and provides other driverless standard, the other standard is used for PPD generation.

Fixes Fedora issue

tillkamppeter commented 9 months ago

Thanks for the PR, I have merged it now.

In reality, all the 3 Raster output formats, not only Apple Raster, but also PWG Raster and PCLm have additional printer IPP attributes (pwg-... and pclm-...) describing which resolutions, color modes, ... are accepted when using the format. So to make it perfect one should also check for PWG Raster and PCLm whether these additional attributes are actually there and so raster data working on the printer can be generated.

zdohnal commented 9 months ago

@tillkamppeter sounds great!

I see pclm-source-resolution-supported as required for PCLm, and pwg-raster-document-resolution-supported for PWG Raster in the generator (the IPP Everywhere standard marks several other attrs as required, but I guess our generators want to be permissive...) - sounds good to add checks for them?

tillkamppeter commented 9 months ago

Yes, I would do so, so that the formats PWG Raster and/or PCLm are only accepted if there is sufficient info to generate them correctly.

For me it looks like that document-format-supported does not change with the settings done in the web admin interface of the printer, but the urf-supported, pwg-..., and pclm-... attributes are included or not included depending on which format are turned on and which are turned off by the web interface. It would be correct if document-format-supported also varies accordingly with the settings. But as this is not the case we have to check for the required attribute being present in order to accept a certain input format.