Skip to main content
June 28, 2012
Question

Loading local PDF, iOS, iPad2

  • June 28, 2012
  • 1 reply
  • 820 views

Hi

I'm trying to make my application view local PDF on iPad. This pdf was downloaded from internet into app-storage dir.  Here is some code:

var f:File = new File(obj.url);

var webView = new StageWebView();

webView.stage=parent.stage;

webView.viewPort=new Rectangle(,20,103,960,640);

//this doesn't work

webView.loadUrl(f.url);

//.. but this works ok.

//webView.loadURL("http://www.adobe.com/devnet/flex/pdfs/getting_started_with_Flex3.pdf")

File url is correct:

"file:///var/mobile/Applications/5053796F-3E4A-41A5-AF05-A2F2D0E71791/Library/Application%20Support/..."

Target file exists.

But PDF document isn't shown.

Could you help me with this issue please?

Thanks in advance.

This topic has been closed for replies.

1 reply

Adobe Employee
June 28, 2012

Hi,

Can you try pointing the pdf using the following web links used in AIR:

http://livedocs.adobe.com/flex/3/html/help.html?content=Filesystem_03.html

Thanks

June 28, 2012

Hi Ankush Bangroo

Yes, I tried to use url and nativePath. It works on desktop, and doesn't work on iPad - just shows grey area without loaded document,

Though when I point document on the web-server - it works perfectly.on both - mobile and desktop.

June 28, 2012

It's even more - I'm trying to listen for errors using

webView.addEventListener(ErrorEvent.ERROR,function(e){ ... });

... and I didn't get any errors...

Is there ANY way to show downloaded PDF on iPad, or should I download it using StageWebView each time?