LinuxでAirPrintを使う。
設定
- 関連するパッケージをインストールする。
- avahi
- cups-ipptool
- /etc/cups/cups-browsed.conf
- 「CreateIPPPrinterQueues all」を追加。
- systemctl restart cups-browsed
- 以下のコマンドで動作確認ができる。うまく動作していれば、自動で認識しているはず。
- cups-browsed –debug
- avahi-browse -a -t
- avahi-browse -rt _ipp._tcp
- ipptool -tv ipp://Canonce9739.local:631/ipp/print get-printer-attributes.test
# ippfind
ipp://Canonce9739.local:631/ipp/print
# driverless
ipp://Canon%20MF642C%2F644C._ipp._tcp.local/
# driverless list
DEBUG: Started ippfind (PID 9573)
DEBUG: Started post-processing (PID 9574)
"driverless:ipp://Canon%20MF642C%2F644C._ipp._tcp.local/" en "Canon" "Canon MF642C/644C, driverless, cups-filters 1.27.1" "MFG:Canon;MDL:MF642C/644C;CMD:PDF,PWGRaster,AppleRaster,URF,PWG,JPEG;"
DEBUG: PID 9573 (ippfind) exited with no errors.
DEBUG: PID 9574 (Post-processing) exited with no errors.
# driverless ipp://Canonce9739.local:631/ipp/print
*PPD-Adobe: "4.3"
*FormatVersion: "4.3"
*FileVersion: "1.27.1"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PSVersion: "(3010.000) 0"
*LanguageLevel: "3"
*FileSystem: False
*PCFileName: "drvless.ppd"
*Manufacturer: "CNMF642C/644C"
*ModelName: "CNMF642C/644C CNMF642C/644C"
*Product: "(CNMF642C/644C CNMF642C/644C)"
*NickName: "CNMF642C/644C CNMF642C/644C, driverless, cups-filters 1.27.1"
*ShortNickName: "CNMF642C/644C CNMF642C/644C"
*DefaultOutputOrder: Normal
*ColorDevice: True
*cupsVersion: 2.2
*cupsSNMPSupplies: False
*cupsLanguages: "en"
*APSupplies: "http://Canonce9739.local:80/airprint.html"
*cupsFilter2: "application/vnd.cups-pdf application/pdf 0 -"
*cupsFilter2: "image/urf image/urf 100 -"
*cupsFilter2: "image/jpeg image/jpeg 0 -"
*OpenUI *PageSize/Media Size: PickOne
*OrderDependency: 10 AnySetup *PageSize
*DefaultPageSize: Postcard
*PageSize 120x235mm/Chou 3 Envelope: "<</PageSize[340.157480314961 666.141732283465]>>setpagedevice"
*PageSize 205.7x337.8mm: "<</PageSize[583.086614173228 957.543307086614]>>setpagedevice"
*PageSize 215.9x317.5mm: "<</PageSize[612 900]>>setpagedevice"
*PageSize 215x345mm: "<</PageSize[609.448818897638 977.952755905512]>>setpagedevice"
*PageSize 8.5x12.5: "<</PageSize[612 900]>>setpagedevice"
*PageSize 8x10/8 x 10": "<</PageSize[576 720]>>setpagedevice"
*PageSize 8x13/8 x 13": "<</PageSize[576 936]>>setpagedevice"
*PageSize A4/A4: "<</PageSize[595.275590551181 841.889763779528]>>setpagedevice"
*PageSize A5/A5: "<</PageSize[419.527559055118 595.275590551181]>>setpagedevice"
*PageSize B5/JIS B5: "<</PageSize[515.905511811024 728.503937007874]>>setpagedevice"
*PageSize DoublePostcardRotated/Oufuku Reply Postcard: "<</PageSize[419.527559055118 566.929133858268]>>setpagedevice"
*PageSize EnvChou3/Chou 3 Envelope: "<</PageSize[340.157480314961 666.141732283465]>>setpagedevice"
*PageSize Executive/Executive: "<</PageSize[522 756]>>setpagedevice"
*PageSize FanFoldGermanLegal/Foolscap: "<</PageSize[612 936]>>setpagedevice"
*PageSize Legal/US Legal: "<</PageSize[612 1008]>>setpagedevice"
*PageSize Letter/US Letter: "<</PageSize[612 792]>>setpagedevice"
*PageSize Oficio/8.5 x 13.4": "<</PageSize[612 964.8]>>setpagedevice"
*PageSize Postcard/Hagaki: "<</PageSize[283.464566929134 419.527559055118]>>setpagedevice"
*PageSize Statement/Statement: "<</PageSize[396 612]>>setpagedevice"
*CloseUI: *PageSize
*OpenUI *PageRegion/Media Size: PickOne
*OrderDependency: 10 AnySetup *PageRegion
*DefaultPageRegion: Postcard
*PageRegion 120x235mm/Chou 3 Envelope: "<</PageSize[340.157480314961 666.141732283465]>>setpagedevice"
*PageRegion 205.7x337.8mm: "<</PageSize[583.086614173228 957.543307086614]>>setpagedevice"
*PageRegion 215.9x317.5mm: "<</PageSize[612 900]>>setpagedevice"
*PageRegion 215x345mm: "<</PageSize[609.448818897638 977.952755905512]>>setpagedevice"
*PageRegion 8.5x12.5: "<</PageSize[612 900]>>setpagedevice"
*PageRegion 8x10/8 x 10": "<</PageSize[576 720]>>setpagedevice"
*PageRegion 8x13/8 x 13": "<</PageSize[576 936]>>setpagedevice"
*PageRegion A4/A4: "<</PageSize[595.275590551181 841.889763779528]>>setpagedevice"
*PageRegion A5/A5: "<</PageSize[419.527559055118 595.275590551181]>>setpagedevice"
*PageRegion B5/JIS B5: "<</PageSize[515.905511811024 728.503937007874]>>setpagedevice"
*PageRegion DoublePostcardRotated/Oufuku Reply Postcard: "<</PageSize[419.527559055118 566.929133858268]>>setpagedevice"
*PageRegion EnvChou3/Chou 3 Envelope: "<</PageSize[340.157480314961 666.141732283465]>>setpagedevice"
*PageRegion Executive/Executive: "<</PageSize[522 756]>>setpagedevice"
*PageRegion FanFoldGermanLegal/Foolscap: "<</PageSize[612 936]>>setpagedevice"
*PageRegion Legal/US Legal: "<</PageSize[612 1008]>>setpagedevice"
*PageRegion Letter/US Letter: "<</PageSize[612 792]>>setpagedevice"
*PageRegion Oficio/8.5 x 13.4": "<</PageSize[612 964.8]>>setpagedevice"
*PageRegion Postcard/Hagaki: "<</PageSize[283.464566929134 419.527559055118]>>setpagedevice"
*PageRegion Statement/Statement: "<</PageSize[396 612]>>setpagedevice"
*CloseUI: *PageRegion
*DefaultImageableArea: Postcard
*DefaultPaperDimension: Postcard
*ImageableArea 120x235mm: "14.173228346457 14.173228346457 325.984251968504 651.968503937008"
*PaperDimension 120x235mm: "340.157480314961 666.141732283465"
*ImageableArea 205.7x337.8mm: "14.173228346457 14.173228346457 568.913385826772 943.370078740158"
*PaperDimension 205.7x337.8mm: "583.086614173228 957.543307086614"
*ImageableArea 215.9x317.5mm: "14.173228346457 14.173228346457 597.826771653543 885.826771653543"
*PaperDimension 215.9x317.5mm: "612 900"
*ImageableArea 215x345mm: "14.173228346457 14.173228346457 595.275590551181 963.779527559055"
*PaperDimension 215x345mm: "609.448818897638 977.952755905512"
*ImageableArea 8.5x12.5: "14.173228346457 14.173228346457 597.826771653543 885.826771653543"
*PaperDimension 8.5x12.5: "612 900"
*ImageableArea 8x10: "14.173228346457 14.173228346457 561.826771653543 705.826771653543"
*PaperDimension 8x10: "576 720"
*ImageableArea 8x13: "14.173228346457 14.173228346457 561.826771653543 921.826771653543"
*PaperDimension 8x13: "576 936"
*ImageableArea A4: "14.173228346457 14.173228346457 581.102362204724 827.716535433071"
*PaperDimension A4: "595.275590551181 841.889763779528"
*ImageableArea A5: "14.173228346457 14.173228346457 405.354330708661 581.102362204724"
*PaperDimension A5: "419.527559055118 595.275590551181"
*ImageableArea B5: "14.173228346457 14.173228346457 501.732283464567 714.330708661417"
*PaperDimension B5: "515.905511811024 728.503937007874"
*ImageableArea DoublePostcardRotated: "14.173228346457 14.173228346457 405.354330708661 552.755905511811"
*PaperDimension DoublePostcardRotated: "419.527559055118 566.929133858268"
*ImageableArea EnvChou3: "14.173228346457 14.173228346457 325.984251968504 651.968503937008"
*PaperDimension EnvChou3: "340.157480314961 666.141732283465"
*ImageableArea Executive: "14.173228346457 14.173228346457 507.826771653543 741.826771653543"
*PaperDimension Executive: "522 756"
*ImageableArea FanFoldGermanLegal: "14.173228346457 14.173228346457 597.826771653543 921.826771653543"
*PaperDimension FanFoldGermanLegal: "612 936"
*ImageableArea Legal: "14.173228346457 14.173228346457 597.826771653543 993.826771653543"
*PaperDimension Legal: "612 1008"
*ImageableArea Letter: "14.173228346457 14.173228346457 597.826771653543 777.826771653543"
*PaperDimension Letter: "612 792"
*ImageableArea Oficio: "14.173228346457 14.173228346457 597.826771653543 950.626771653543"
*PaperDimension Oficio: "612 964.8"
*ImageableArea Postcard: "14.173228346457 14.173228346457 269.291338582677 405.354330708661"
*PaperDimension Postcard: "283.464566929134 419.527559055118"
*ImageableArea Statement: "14.173228346457 14.173228346457 381.826771653543 597.826771653543"
*PaperDimension Statement: "396 612"
*HWMargins: "14.173228346457 14.173228346457 14.173228346457 14.173228346457"
*ParamCustomPageSize Width: 1 points 216 612.283464566929
*ParamCustomPageSize Height: 2 points 360 1008
*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: Tray1
*InputSlot Auto/Automatic: "<</MediaPosition 0>>setpagedevice"
*InputSlot ByPassTray/By Pass Tray: "<</MediaPosition 19>>setpagedevice"
*InputSlot Tray1/Tray 1: "<</MediaPosition 20>>setpagedevice"
*CloseUI: *InputSlot
*OpenUI *MediaType/Media Type: PickOne
*OrderDependency: 10 AnySetup *MediaType
*DefaultMediaType: Auto
*MediaType Stationery/Stationery: "<</MediaType(Stationery)>>setpagedevice"
*MediaType StationeryLightweight/Lightweight Paper: "<</MediaType(StationeryLightweight)>>setpagedevice"
*MediaType StationeryHeavyweight/Heavyweight Paper: "<</MediaType(StationeryHeavyweight)>>setpagedevice"
*MediaType Envelope/Envelope: "<</MediaType(Envelope)>>setpagedevice"
*MediaType Labels/Labels: "<</MediaType(Labels)>>setpagedevice"
*CloseUI: *MediaType
*OpenUI *ColorModel/Print Color Mode: PickOne
*OrderDependency: 10 AnySetup *ColorModel
*ColorModel AdobeRGB/Deep Color (Wide Color Gamut, AdobeRGB): "<</cupsColorSpace 20/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice"
*ColorModel RGB/Color: "<</cupsColorSpace 19/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice"
*ColorModel Gray/Monochrome: "<</cupsColorSpace 18/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice"
*DefaultColorModel: RGB
*CloseUI: *ColorModel
*OpenUI *Duplex/2-Sided Printing: PickOne
*OrderDependency: 10 AnySetup *Duplex
*DefaultDuplex: None
*Duplex None/Off: "<</Duplex false>>setpagedevice"
*Duplex DuplexNoTumble/On (Portrait): "<</Duplex true/Tumble false>>setpagedevice"
*Duplex DuplexTumble/On (Landscape): "<</Duplex true/Tumble true>>setpagedevice"
*CloseUI: *Duplex
*cupsBackSide: Normal
*OpenUI *cupsFinishingTemplate/Finishing Preset: PickOne
*OrderDependency: 10 AnySetup *cupsFinishingTemplate
*DefaultcupsFinishingTemplate: none
*cupsFinishingTemplate none/None: ""
*CloseUI: *cupsFinishingTemplate
*DefaultResolution: 300dpi
*OpenUI *cupsPrintQuality/Print Quality: PickOne
*OrderDependency: 10 AnySetup *cupsPrintQuality
*DefaultcupsPrintQuality: Normal
*cupsPrintQuality Draft/Draft: "<</HWResolution[300 300]>>setpagedevice"
*cupsPrintQuality Normal/Normal: "<</HWResolution[300 300]>>setpagedevice"
*CloseUI: *cupsPrintQuality
*OpenUI *print-scaling/Print Scaling: PickOne
*OrderDependency: 10 AnySetup *print-scaling
*Defaultprint-scaling: auto
*print-scaling auto/Automatic: ""
*print-scaling auto-fit/Auto Fit: ""
*print-scaling fill/Fill: ""
*print-scaling fit/Fit: ""
*print-scaling none/None: ""
*CloseUI: *print-scaling
印刷してみる
- まずprintfile.ippを作成。
{
OPERATION Print-Job
GROUP operation-attributes-tag
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
ATTR uri printer-uri $uri
FILE $filename
}
- ipptoolで印刷。
# ipptool -tv -f sample.jpg ipp://192.168.0.7:631/ipp/print printfile.ipp
"printfile.ipp":
Print-Job:
attributes-charset (charset) = utf-8
attributes-natural-language (naturalLanguage) = en
printer-uri (uri) = ipp://192.168.0.7:631/ipp/print
printfile [PASS]
RECEIVED: 254 bytes in response
status-code = successful-ok (successful-ok)
attributes-charset (charset) = utf-8
attributes-natural-language (naturalLanguage) = ja-jp
job-uri (uri) = ipp://192.168.0.7:631/ipp/print/job-1
job-id (integer) = 1
job-state (enum) = processing
job-state-reasons (keyword) = job-transforming
job-uuid (uri) = urn:uuid:1354d532-65b7-11ea-8003-f4a997ce9739