apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.91k stars 462 forks source link

Create PPD file from get-printer-attributes #5238

Closed mfauvain closed 6 years ago

mfauvain commented 6 years ago

Hi, trying to get a Canon Pixma Pro 10 to work with ubuntu 17.10 + cups 2.2.4. Not able to get anything working even with driverless ipp config in cups (which seems weird to me as ipp driverless printing works even with my iphone) Then I stumbled upon this excellent appimage and finally managed to get a printed photo out! I have the complete printer attributes from ippsample ipptool -t -v ipp://....../ipp/print get-printer-attributes-2.0.test and was wondering if I could possibly get a .ppd file generated from ippsample to then use this when configuring the printer in cups. Any help greatly appreciated

KurtPfeifle commented 6 years ago

Which appimage are you talking about?

mfauvain commented 6 years ago

the appimage I used to get the photo printed out is ippsample. worked perfect. however when I want to print from cups directly it fails, even though cups discover the printer and has it as driverless ipp printer.. So my idea was that cups had a wrong .ppd file generated. On the other hand ippsample seems to have it right.

mfauvain commented 6 years ago

With a bit more time into it, I realized ippsample is just a helper/sample that uses the ipptool function that comes with CUPS. Still, I don't understand why ipptool prints correctly but cups (from cups:631 web) doesnt. the only way to have a print is from cli tool ipptool. From any app (using gnome) it doesnt print, from cups web (print test page) it doesnt print.. so back to my doubt, is it a .ppd issue? is the one generated by cups wrong?

michaelrsweet commented 6 years ago

@mfauvain ipptool submits the file directly to the printer, while CUPS runs filters to generate a printable file. It is entirely possible that the filters or PPD are not right, particularly in CUPS 2.2.4 (current stable 2.2.x is 2.2.6), and since this particular printer doesn't support IPP Everywhere you are depending on unsupported (beta) code for generating Apple raster data for the printer when printing through CUPS. (the printer supports JPEG natively, which is why you can print via ipptool)

If possible, can you test against the current stable release (2.2.6)?

mfauvain commented 6 years ago

@michaelrsweet, thank you for the help. I tried cups 2.2.6 but still no printing. I've noticed though the cups-filter version is the same as when using cups 2.2.4. I see both using cups-filter 1.17.9. You say the printer doesn't support IPP everywhere, but I can print jpeg, pdf etc from my phone (with no driver here), isn't this ipp everywhere?

mfauvain commented 6 years ago

Installed cups-filter 1.19.0 but still no printing from cups...

mfauvain commented 6 years ago

Installed Cups 2.3b2/ cups filter 1.19.0 but still no printing from cups.

michaelrsweet commented 6 years ago

@mfauvain This printer supports AirPrint, which is not the same as IPP Everywhere (two different, if related, standards). Your phone is converting PDFs to a raster format that is supported by the printer. Your CUPS system needs to the same, but it sounds like something isn't working properly.

It would be VERY helpful if you can attach the generated PPD to this issue - you'll find the PPD under /etc/cups/ppd.

Thank you!

mfauvain commented 6 years ago

Here is the .ppd generated by cups 2.2.4/filter 1.17.9 from earlier. I'll post the one generated by the latest install (cups 2.3b2/filter 1.19.0) in a moment.

PPD-Adobe: "4.3" FormatVersion: "4.3" FileVersion: "2.2" LanguageVersion: English LanguageEncoding: ISOLatin1 PSVersion: "(3010.000) 705" LanguageLevel: "3" FileSystem: False PCFileName: "ippeve.ppd" Manufacturer: "Canon" ModelName: "Canon PRO-10 series" Product: "(Canon PRO-10 series)" NickName: "Canon PRO-10 series, driverless, cups-filters 1.17.9" ShortNickName: "Canon PRO-10 series" ColorDevice: True cupsVersion: 2.2 cupsSNMPSupplies: False cupsLanguages: "en" cupsFilter2: "image/pwg-raster image/pwg-raster 0 -" cupsFilter2: "image/urf image/urf 100 -" cupsFilter2: "image/jpeg image/jpeg 0 -" OpenUI PageSize: PickOne OrderDependency: 10 AnySetup PageSize DefaultPageSize: Letter PageSize 3.5x5: "<</PageSize[252 360]>>setpagedevice" PageSize Postcard: "<</PageSize[283.464566929134 419.527559055118]>>setpagedevice" PageSize 4x6: "<</PageSize[288 432]>>setpagedevice" PageSize 5x7: "<</PageSize[360 504]>>setpagedevice" PageSize A5: "<</PageSize[419.527559055118 595.275590551181]>>setpagedevice" PageSize B5: "<</PageSize[515.905511811024 728.503937007874]>>setpagedevice" PageSize 8x10: "<</PageSize[576 720]>>setpagedevice" PageSize A4: "<</PageSize[595.275590551181 841.889763779528]>>setpagedevice" PageSize Letter: "<</PageSize[612 792]>>setpagedevice" PageSize Legal: "<</PageSize[612 1008]>>setpagedevice" PageSize B4: "<</PageSize[728.503937007874 1031.811023622047]>>setpagedevice" PageSize Tabloid: "<</PageSize[792 1224]>>setpagedevice" PageSize A3: "<</PageSize[841.889763779528 1190.551181102362]>>setpagedevice" CloseUI: PageSize OpenUI PageRegion: PickOne OrderDependency: 10 AnySetup PageRegion DefaultPageRegion: Letter PageRegion 3.5x5: "<</PageSize[252 360]>>setpagedevice" PageRegion Postcard: "<</PageSize[283.464566929134 419.527559055118]>>setpagedevice" PageRegion 4x6: "<</PageSize[288 432]>>setpagedevice" PageRegion 5x7: "<</PageSize[360 504]>>setpagedevice" PageRegion A5: "<</PageSize[419.527559055118 595.275590551181]>>setpagedevice" PageRegion B5: "<</PageSize[515.905511811024 728.503937007874]>>setpagedevice" PageRegion 8x10: "<</PageSize[576 720]>>setpagedevice" PageRegion A4: "<</PageSize[595.275590551181 841.889763779528]>>setpagedevice" PageRegion Letter: "<</PageSize[612 792]>>setpagedevice" PageRegion Legal: "<</PageSize[612 1008]>>setpagedevice" PageRegion B4: "<</PageSize[728.503937007874 1031.811023622047]>>setpagedevice" PageRegion Tabloid: "<</PageSize[792 1224]>>setpagedevice" PageRegion A3: "<</PageSize[841.889763779528 1190.551181102362]>>setpagedevice" CloseUI: PageRegion DefaultImageableArea: Letter DefaultPaperDimension: Letter ImageableArea 3.5x5: "18.141732283465 14.173228346457 234.141732283465 345.826771653543" PaperDimension 3.5x5: "252 360" ImageableArea Postcard: "18.141732283465 14.173228346457 265.606299212598 405.354330708661" PaperDimension Postcard: "283.464566929134 419.527559055118" ImageableArea 4x6: "18.141732283465 14.173228346457 270.141732283465 417.826771653543" PaperDimension 4x6: "288 432" ImageableArea 5x7: "18.141732283465 14.173228346457 342.141732283465 489.826771653543" PaperDimension 5x7: "360 504" ImageableArea A5: "18.141732283465 14.173228346457 401.669291338583 581.102362204724" PaperDimension A5: "419.527559055118 595.275590551181" ImageableArea B5: "18.141732283465 14.173228346457 498.047244094488 714.330708661417" PaperDimension B5: "515.905511811024 728.503937007874" ImageableArea 8x10: "18.141732283465 14.173228346457 558.141732283465 705.826771653543" PaperDimension 8x10: "576 720" ImageableArea A4: "18.141732283465 14.173228346457 577.417322834646 827.716535433071" PaperDimension A4: "595.275590551181 841.889763779528" ImageableArea Letter: "18.141732283465 14.173228346457 594.141732283465 777.826771653543" PaperDimension Letter: "612 792" ImageableArea Legal: "18.141732283465 14.173228346457 594.141732283465 993.826771653543" PaperDimension Legal: "612 1008" ImageableArea B4: "18.141732283465 14.173228346457 710.645669291339 1017.637795275591" PaperDimension B4: "728.503937007874 1031.811023622047" ImageableArea Tabloid: "18.141732283465 14.173228346457 774.141732283465 1209.826771653543" PaperDimension Tabloid: "792 1224" ImageableArea A3: "18.141732283465 14.173228346457 824.031496062992 1176.377952755905" PaperDimension A3: "841.889763779528 1190.551181102362" OpenUI InputSlot: PickOne OrderDependency: 10 AnySetup InputSlot DefaultInputSlot: Manual InputSlot Auto/Automatic: "<</MediaPosition 0>>setpagedevice" InputSlot Rear/Rear: "<</MediaPosition 18>>setpagedevice" InputSlot Manual/Manual: "<</MediaPosition 4>>setpagedevice" CloseUI: InputSlot OpenUI MediaType: PickOne OrderDependency: 10 AnySetup MediaType DefaultMediaType: Photographic MediaType Photographic/Photo Paper: "<</MediaType(Photographic)>>setpagedevice" MediaType Stationery/Plain Paper: "<</MediaType(Stationery)>>setpagedevice" CloseUI: MediaType OpenUI ColorModel/Color Mode: PickOne OrderDependency: 10 AnySetup ColorModel ColorModel RGB/Color: "<</cupsColorSpace 19/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice" ColorModel Gray/Grayscale: "<</cupsColorSpace 18/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice" DefaultColorModel: RGB CloseUI: ColorModel DefaultResolution: 600dpi OpenUI cupsPrintQuality/Print Quality: PickOne OrderDependency: 10 AnySetup cupsPrintQuality DefaultcupsPrintQuality: 4 cupsPrintQuality 4/Normal: "<</HWResolution[600 600]>>setpagedevice" cupsPrintQuality 5/High: "<</HWResolution[600 600]>>setpagedevice" CloseUI: *cupsPrintQuality

michaelrsweet commented 6 years ago

This PPD isn't from CUPS or is using some unsupported fork of the CUPS PPD generator. I don't believe that this particular printer actually supports PWG Raster files for printing (which is what the PPD says), and thus when you try to print the printer is rejecting what is being sent to it.

Try using:

lpadmin -p printer-name -E -v ipp://printer-address/ipp/print -m everywhere
mfauvain commented 6 years ago

I am away and printer is not connected at moment so cant try lpadmin line. I did however tried that excat same line last week with no succes (maybe was with cups 2.2.4 still though).. Will connect printer and report asap. In the meantime, here is the .ppd generated by cups 2.3b2/filter 1.19 (weird it still has cups version as 2.2 when I confirm the running version is 2.3b2)

[x@Archie ~]$ cups-config --version 2.3b2

PPD-Adobe: "4.3" FormatVersion: "4.3" FileVersion: "1.19.0" LanguageVersion: English LanguageEncoding: ISOLatin1 PSVersion: "(3010.000) 0" LanguageLevel: "3" FileSystem: False PCFileName: "drvless.ppd" Manufacturer: "Canon" ModelName: "Canon PRO-10 series" Product: "(Canon PRO-10 series)" NickName: "Canon PRO-10 series, driverless, cups-filters 1.19.0" ShortNickName: "Canon PRO-10 series" ColorDevice: True cupsVersion: 2.2 cupsSNMPSupplies: False cupsLanguages: "en" APSupplies: "http://000000F8A378.local./index.html?PAGE_AAP" cupsFilter2: "image/pwg-raster image/pwg-raster 0 -" cupsFilter2: "image/urf image/urf 100 -" cupsFilter2: "image/jpeg image/jpeg 0 -" OpenUI PageSize/Media Size: PickOne OrderDependency: 10 AnySetup PageSize DefaultPageSize: A4 PageSize 3.5x5/3.5 x 5": "<</PageSize[252 360]>>setpagedevice" PageSize 4x6/4 x 6": "<</PageSize[288 432]>>setpagedevice" PageSize 5x7/5 x 7": "<</PageSize[360 504]>>setpagedevice" PageSize 8x10/8 x 10": "<</PageSize[576 720]>>setpagedevice" PageSize A3/A3: "<</PageSize[841.889763779528 1190.551181102362]>>setpagedevice" PageSize A4/A4: "<</PageSize[595.275590551181 841.889763779528]>>setpagedevice" PageSize A5/A5: "<</PageSize[419.527559055118 595.275590551181]>>setpagedevice" PageSize B4/JIS B4: "<</PageSize[728.503937007874 1031.811023622047]>>setpagedevice" PageSize B5/JIS B5: "<</PageSize[515.905511811024 728.503937007874]>>setpagedevice" PageSize Legal/US Legal: "<</PageSize[612 1008]>>setpagedevice" PageSize Letter/US Letter: "<</PageSize[612 792]>>setpagedevice" PageSize Postcard/Hagaki: "<</PageSize[283.464566929134 419.527559055118]>>setpagedevice" PageSize Tabloid/11 x 17": "<</PageSize[792 1224]>>setpagedevice" CloseUI: PageSize OpenUI PageRegion/Media Size: PickOne OrderDependency: 10 AnySetup PageRegion DefaultPageRegion: A4 PageRegion 3.5x5/3.5 x 5": "<</PageSize[252 360]>>setpagedevice" PageRegion 4x6/4 x 6": "<</PageSize[288 432]>>setpagedevice" PageRegion 5x7/5 x 7": "<</PageSize[360 504]>>setpagedevice" PageRegion 8x10/8 x 10": "<</PageSize[576 720]>>setpagedevice" PageRegion A3/A3: "<</PageSize[841.889763779528 1190.551181102362]>>setpagedevice" PageRegion A4/A4: "<</PageSize[595.275590551181 841.889763779528]>>setpagedevice" PageRegion A5/A5: "<</PageSize[419.527559055118 595.275590551181]>>setpagedevice" PageRegion B4/JIS B4: "<</PageSize[728.503937007874 1031.811023622047]>>setpagedevice" PageRegion B5/JIS B5: "<</PageSize[515.905511811024 728.503937007874]>>setpagedevice" PageRegion Legal/US Legal: "<</PageSize[612 1008]>>setpagedevice" PageRegion Letter/US Letter: "<</PageSize[612 792]>>setpagedevice" PageRegion Postcard/Hagaki: "<</PageSize[283.464566929134 419.527559055118]>>setpagedevice" PageRegion Tabloid/11 x 17": "<</PageSize[792 1224]>>setpagedevice" CloseUI: PageRegion DefaultImageableArea: A4 DefaultPaperDimension: A4 ImageableArea 3.5x5: "18.141732283465 14.173228346457 234.141732283465 345.826771653543" PaperDimension 3.5x5: "252 360" ImageableArea 4x6: "18.141732283465 14.173228346457 270.141732283465 417.826771653543" PaperDimension 4x6: "288 432" ImageableArea 5x7: "18.141732283465 14.173228346457 342.141732283465 489.826771653543" PaperDimension 5x7: "360 504" ImageableArea 8x10: "18.141732283465 14.173228346457 558.141732283465 705.826771653543" PaperDimension 8x10: "576 720" ImageableArea A3: "18.141732283465 14.173228346457 824.031496062992 1176.377952755905" PaperDimension A3: "841.889763779528 1190.551181102362" ImageableArea A4: "18.141732283465 14.173228346457 577.417322834646 827.716535433071" PaperDimension A4: "595.275590551181 841.889763779528" ImageableArea A5: "18.141732283465 14.173228346457 401.669291338583 581.102362204724" PaperDimension A5: "419.527559055118 595.275590551181" ImageableArea B4: "18.141732283465 14.173228346457 710.645669291339 1017.637795275591" PaperDimension B4: "728.503937007874 1031.811023622047" ImageableArea B5: "18.141732283465 14.173228346457 498.047244094488 714.330708661417" PaperDimension B5: "515.905511811024 728.503937007874" ImageableArea Legal: "18.141732283465 14.173228346457 594.141732283465 993.826771653543" PaperDimension Legal: "612 1008" ImageableArea Letter: "18.141732283465 14.173228346457 594.141732283465 777.826771653543" PaperDimension Letter: "612 792" ImageableArea Postcard: "18.141732283465 14.173228346457 265.606299212598 405.354330708661" PaperDimension Postcard: "283.464566929134 419.527559055118" ImageableArea Tabloid: "18.141732283465 14.173228346457 774.141732283465 1209.826771653543" PaperDimension Tabloid: "792 1224" HWMargins: "18.141732283465 14.173228346457 17.858267716535 14.173228346457" ParamCustomPageSize Width: 1 points 252.283464566929 1008 ParamCustomPageSize Height: 2 points 360 1916.220472440945 ParamCustomPageSize WidthOffset: 3 points 0 0 ParamCustomPageSize HeightOffset: 4 points 0 0 ParamCustomPageSize Orientation: 5 int 0 3 CustomPageSize True: "pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice" OpenUI InputSlot/Media Source: PickOne OrderDependency: 10 AnySetup InputSlot DefaultInputSlot: Rear InputSlot Auto/Automatic: "<</MediaPosition 0>>setpagedevice" InputSlot Rear/Rear: "<</MediaPosition 18>>setpagedevice" InputSlot Manual/Manual: "<</MediaPosition 4>>setpagedevice" CloseUI: InputSlot OpenUI MediaType/Media Type: PickOne OrderDependency: 10 AnySetup MediaType DefaultMediaType: Photographic MediaType Photographic/Photo Paper: "<</MediaType(Photographic)>>setpagedevice" MediaType Stationery/Stationery: "<</MediaType(Stationery)>>setpagedevice" CloseUI: MediaType OpenUI ColorModel/Print Color Mode: PickOne OrderDependency: 10 AnySetup ColorModel ColorModel RGB/Color: "<</cupsColorSpace 19/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice" ColorModel Gray/Grayscale: "<</cupsColorSpace 18/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice" DefaultColorModel: RGB CloseUI: ColorModel DefaultResolution: 600dpi OpenUI cupsPrintQuality/Print Quality: PickOne OrderDependency: 10 AnySetup cupsPrintQuality DefaultcupsPrintQuality: 4 cupsPrintQuality 4/Normal: "<</HWResolution[600 600]>>setpagedevice" cupsPrintQuality 5/High: "<</HWResolution[600 600]>>setpagedevice" CloseUI: cupsPrintQuality OpenUI print-scaling/Print Scaling: PickOne OrderDependency: 10 AnySetup print-scaling Defaultprint-scaling: auto print-scaling none/None: "" print-scaling fill/Fill: "" print-scaling fit/Fit: "" print-scaling auto-fit/Auto Fit: "" print-scaling auto/Automatic: "" CloseUI: *print-scaling

mfauvain commented 6 years ago

Here is the .ppd generated with lpadmin command (ColorJetTest.ppd I've just added a .txt extension to be able to upload it here). I've also managed to find the .ppd generated (upon driver install) on an OSX machine I have here. I've also setup this printer as AirPrint on OSX but cant find the corresponding .ppd..

ColorJetTest.ppd.txt MACOSX-CanonIJPRO10series.ppd.txt

mfauvain commented 6 years ago

Maybe another piece to this puzzle, avahi broswe shows the only file format advertised by the printer are : TXT pdl = application/octet-stream,image/urf,image/jpeg

michaelrsweet commented 6 years ago

@mfauvain Can you run the following command and attach the output to this issue?

ipptool -tv ipp://printer-address/ipp/print get-printer-attributes.test >attributes.txt

Thanks!

michaelrsweet commented 6 years ago

Closing for lack of a response; can re-open if we have the information requested above...

mfauvain commented 6 years ago

Hi Michael, sorry was out for some time, back in 2d and will send requested info.

mfauvain commented 6 years ago

Printer attributes as requested. attributes.txt

michaelrsweet commented 6 years ago

Reopening for now; my guess is that while this printer reports support for PWG Raster, it may not implement it correctly.

mfauvain commented 6 years ago

So printing from phone uses jpeg? or a different implementation of pwg-raster format?

michaelrsweet commented 6 years ago

Printing a photo will typically use JPEG directly.

For other types of output, PWG Raster is used from Android phones while iPhones use Apple Raster - both share a common heritage and compression codec...

mfauvain commented 6 years ago

ok. I tried printing any document (photo, pdf, docx) from iphone and it works. Any chance to get this working from linux or dead end?

michaelrsweet commented 6 years ago

That's why I reopened the bug... :)

Short term fix: remove the line reading:

*cupsFilter2: "image/pwg-raster image/pwg-raster 100 -"

from the PPD file and then update with:

lpadmin -p queuename -i filename.ppd

where "queuename" is the print queue name and "filename.ppd" is the PPD file you edited.

(the "ColorJetTest.ppd.txt" you attached should work once you remove the pwg-raster line)

mfauvain commented 6 years ago

thank you, will try later on today. So essentially that would allow jpeg and apple image/urf printing, correct?

michaelrsweet commented 6 years ago

Right, and tell CUPS to convert everything else into image/urf.

mfauvain commented 6 years ago

works perfect, thank you vmuch.

michaelrsweet commented 6 years ago

[master e6062e8e9] Fix printing to some IPP Everywhere printers (Issue #5238)

[branch-2.2 b237ae81d] Fix printing to some IPP Everywhere printers (Issue #5238)