How open pdf in Air for Android/Black berry

倾然丶 夕夏残阳落幕 提交于 2019-12-04 16:53:31

StageWebView.

http://help.adobe.com/en_US/as3/dev/WS901d38e593cd1bac3ef1d28412ac57b094b-8000.html

Example copied from the link above:

package  { 
    import flash.display.MovieClip; 
    import flash.media.StageWebView; 
    import flash.geom.Rectangle; 

    public class StageWebViewExample extends MovieClip{ 

        var webView:StageWebView = new StageWebView(); 

        public function StageWebViewExample() { 
            webView.stage = this.stage; 
            webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight ); 
            webView.loadURL( "http://www.adobe.com" ); 
        } 
    } 
}

The StageWebView is the solution #1.

However, this won't work on Android 3 tablets. For activating any plugin (e.g., Flash or PDF) in the StageWebView you need to explictely enable hardware acceleration in the description file. This part would be easy, but Flash CS 5.5 would not package your -app.xml since it checks against the Froyo lib and not the Honeycomb lib. Since the hardwareaccelartion is a feature of Honeycomb, it is unknown for CS5.5.

Here is an immediate need for updating your products Adobe!!!!

So do it with the StageWebView but keep your tablet friends in mind. Give them a message at least.

On android if adobe reader is installed this seems to work:

var oFile:File = new File ( File.documentsDirectory.resolvePath ( "filepath/test.pdf" ).nativePath );
var oUrl:URLRequest = new URLRequest ( "file://" +oFile.nativePath );
navigateToURL ( oUrl );

The important and poorly documented part is prepending "file://" to the path.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!