Created
April 10, 2013 03:18
-
-
Save darkredz/5351493 to your computer and use it in GitHub Desktop.
Using AirPrint in UIWebView ane http://darkredz.com/ios-uiwebview-and-videoplayer-native-extension-for-air-mobile/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function init():void{ | |
nativeWeb = new UIWebView(); | |
nativeWeb.stage = stage; | |
nativeWeb.viewPort = new Rectangle(0,0,1024,748); | |
nativeWeb.loadURL('http://darkredz.com') | |
button.addEventListener(MouseEvent.CLICK, onClick) | |
nativeWeb.addEventListener(PrintJobEvent.COMPLETE, onDone) | |
nativeWeb.addEventListener(PrintJobErrorEvent.ERROR, onError) | |
} | |
private function onClick(e:MouseEvent):void{ | |
//Simple Print | |
nativeWeb.printPage() | |
//print options with location of modal UI, header and footer text | |
//nativeWeb.printPage(PrintInfo.GENERAL,new Point(100,400), 'My Web Page', 'My footer',true) | |
} | |
private function onDone(event:PrintJobEvent):void { | |
trace('Done ' + event.url) | |
} | |
private function onError(event:PrintJobErrorEvent):void { | |
trace(event.toString()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment