open and display a pdf file using actionscript for mobiles (iOS)

眉间皱痕 提交于 2019-12-04 19:32:46

I think StageWebView is what you need.

I've just done a similar thing like this...

var _file:String = "nameOfPdf.pdf";
var webView = new StageWebView();
webView.stage = stage;
webView.viewPort = new Rectangle(20,103,960,640);//specify the clipping mask(x,y,w,h)

//NB I have my pdf file as an included file here (added in the publish panel.
var fPath:String = new File(new File("app:/includes/"+_file).nativePath).url;
webView.loadURL( fPath );

//Alternatively you should be able to navigate to a URL
webView.loadURL("http://www.google.com");

There's an external tool called pdf2swf that will transform a pdf into a working swf that you can add just as any other swf. If all you want is a fixed pdf, you can transform it previously and load the transformed swf directly. But if you want any pdf, you would need a external web server to perform the transformation step.

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