IOS AirPrint功能

IOS AirPrint功能實現必要條件:
設備
A、移動設備
iPad(所有型號)
iPhone(3GS 或者 之後的版本)
iPod touch(第3代或者之後的版本)
B、打印設備
一臺支持AirPrint的打印機,並且該打印機應與IOS移動設備設有相同的WiFi網絡。
支持AirPrint的打印機型號如下:
HYPERLINK "javascript:void(0);"Brother
Brother DCP-J525N
Brother DCP-J525W
Brother DCP-J725DW
Brother DCP-J725N
Brother DCP-J925DW
Brother DCP-J925N
Brother MFC-J280W
Brother MFC-J425W
Brother MFC-J430W
Brother MFC-J432W
Brother MFC-J435W
Brother MFC-J5910DW
Brother MFC-J625DW
Brother MFC-J825DW
Brother MFC-J825N
Brother MFC-J835DW
Brother MFC-J955DN
Brother MFC-J955DWN
HYPERLINK "javascript:void(0);"Canon
Canon MG5310
Canon MG5320
Canon MG5330
Canon MG5340
Canon MG5350
Canon MG5370
Canon MG5380
Canon MG6210
Canon MG6220
Canon MG6230
Canon MG6240
Canon MG6250
Canon MG6270
Canon MG6280
Canon MG8220
Canon MG8230
Canon MG8240
Canon MG8250
Canon MG8270
Canon MG8280
HYPERLINK "javascript:void(0);"EPSON
EPSON Artisan 730
EPSON Artisan 837
EPSON EP-804A
EPSON EP-804AR
EPSON EP-804AW
EPSON EP-904A
EPSON EP-904F
EPSON ME Office 940FW
EPSON PX-1600F
EPSON PX-1700F
EPSON PX-B700
EPSON PX-B750F
EPSON Stylus NX430
EPSON Stylus NX530
EPSON Stylus NX635
EPSON Stylus Office BX535WD
EPSON Stylus Office BX630FW
EPSON Stylus Office BX635FWD
EPSON Stylus Office BX935FWD
EPSON Stylus Photo PX730WD
EPSON Stylus Photo PX830FWD
EPSON Stylus SX440W
EPSON Stylus SX445W
EPSON Stylus SX535WD
EPSON Stylus TX435W
EPSON Stylus Photo TX730WD
EPSON WorkForce 545
EPSON WorkForce 645
EPSON WorkForce 845
EPSON WP-4011
EPSON WP-4015
EPSON WP-4020
EPSON WP-4025
EPSON WP-4511
EPSON WP-4515
EPSON WP-4521
EPSON WP-4525
EPSON WP-4530
EPSON WP-4531
EPSON WP-4535
EPSON WP-4540
EPSON WP-4545
HYPERLINK "javascript:void(0);"Hewlett Packard
HP Deskjet 3050A J611
HP Deskjet 3070A
HP Envy 100 e-All-In-One D410
HP Envy 110 e-All-In-One D411a
HP LaserJet P1102w Printer
HP LaserJet P1606dn Printer
HP LaserJet Pro 100 color MFP M175nw
HP LaserJet Pro CM1415fn Color MFP
HP LaserJet Pro CM1415fnw Color MFP
HP LaserJet Pro CP1025nw Color Printer
HP LaserJet Pro CP1525nw Color Printer
HP LaserJet Pro M1212nf MFP
HP LaserJet Pro M1213nf MFP
HP LaserJet Pro M1214nf MFP
HP LaserJet Pro M1216nf MFP
HP LaserJet Pro M1217nfw MFP
HP LaserJet Pro M1536dnf MFP
HP Officejet 6500A e-All-In-One E710a
HP Officejet 6500A Plus e-All-In-One E710n
HP Officejet 7500A Wide Format e-All-In-One E910a
HP Officejet Pro 8500A e-All-In-One A910a
HP Officejet Pro 8500A Plus e-All-In-One A910g
HP Officejet Pro 8500A Premium e-All-In-One A910g
HP Officejet Pro 8600A e-All-in-One Printer N911a
HP Officejet Pro 8600A Plus e-All-in-One N911g
HP Officejet Pro 8600A Premium e-All-in-One N911g
HP Photosmart 5510 e-AiO B111a
HP Photosmart 5514 e-AiO B111h
HP Photosmart 6510 e-AiO B211a
HP Photosmart 7510 e-AiO C311a
HP Photosmart e-All-in-One D110a
HP Photosmart eStation C510
HP Photosmart Plus e-All-In-One B210a
HP Photosmart Premium e-All-In-One C310
HP Photosmart Premium Fax e-All-In-One C410a
HP Photosmart Wireless e-All-In-One B110—Europe and Asia-Pacific
HP TopShot LaserJet Pro M275
HYPERLINK "javascript:void(0);"Lexmark
Lexmark C792
Lexmark C925
Lexmark C950
Lexmark OfficeEdge Pro4000
Lexmark OfficeEdge Pro4000c
Lexmark OfficeEdge Pro5500
Lexmark OfficeEdge Pro5500t
Lexmark Pro715
Lexmark Pro915
Lexmark X548
Lexmark X792
Lexmark X925
Lexmark X950
Lexmark X952
Lexmark X954

注:其他打印機如果需要使用AirPrint功能可以安裝AirPrint破解程序,具體步驟可參考一下資料:

http://hi.baidu.com/engling/blog/item/785d874411fafd5c510ffee6.html

或者

http://mobile.it168.com/a2010/1126/1131/000001131071_all.shtml


編寫代碼。
在IOS程序中主要使用的是UIPrintInteractionController類實現AirPrint的功能。UIPrintInteractionController類提供給打印內容四個互斥的屬性:
printingItem:            一個單獨的打印對象,設置實例對象可以是NSURL,NSData,UIImage,ALAsset
printingItems:        一組打印對象,實例對象同上
printFormatter:        某種佈局的格式
printPageRenderer:    自定義打印頁面渲染

showsPageRange屬性表示是否顯示頁面範圍。如果showsPageRange設置爲YES,同時頁面大於1,並且設置的屬性是printingItems之外的任一屬性,則打印選項包含選擇頁面範圍選項。

請參看我的資源中的demo。


參考資料:

http://hi.baidu.com/engling/blog/item/785d874411fafd5c510ffee6.html

http://mobile.it168.com/a2010/1126/1131/000001131071_all.shtml

http://support.apple.com/kb/ht4356

http://hi.baidu.com/amigoradio/blog/item/92249d4378c3280b9313c60d.html

http://jingyan.baidu.com/article/1612d500156ac1e20e1eeed6.html

http://www.cocoachina.com/iphonedev/sdk/2011/0513/2851.html

http://www.yifeiyang.net/iphone-web-development-skills-of-the-article-4-make-sure-the-network-environment-3gwifi/

https://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/Printing/Printing.html

http://stackoverflow.com/questions/992348/reading-html-content-from-a-uiwebview

http://www.cocoabuilder.com/archive/cocoa/296745-playing-with-ios-uiprintinteractioncontroller-to-generate-pdf-output.html

http://stackoverflow.com/questions/5817840/print-paper-size-and-content-inset

http://stackoverflow.com/questions/1005521/iphone-nsdata-nsurl-with-cookie

http://www.iphonedevsdk.com/forum/iphone-sdk-development/5608-uiwebview-how-get-content-shown.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章