• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Opening PDF stored on ApplicationDirectory within iOS

Explorer ,
Oct 31, 2018 Oct 31, 2018

Copy link to clipboard

Copied

Hi,

I've been trying to make an Adobe AIR app open a PDF using File.openWithDefaultApplication() but it appears to be not compatible with iOS. (works on Desktop no worries). Is there a way to get a PDF to be opened with the users default reader (e.g. iBooks, Adobe Reader etc).

I've had a check through the documentation and I think I must be looking in the wrong place

Thanks

TOPICS
ActionScript

Views

662

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Nov 06, 2018 Nov 06, 2018

Ok so I was able to get the app to interface with the iOS Share mode. Creating a PDF seems to work but copy to iBooks does not

I used the following ANE which is not listed on the ANE directory on the Adobe site but appears to work no problems

GitHub - katopz/ane-device-file-util: ANE 64-bit for open file with registered application on iOS

Make sure you are running the newest version of iOS and AIR SDK

Big thanks to JoãoCésar for his help

Votes

Translate

Translate
New Here ,
Nov 01, 2018 Nov 01, 2018

Copy link to clipboard

Copied

So what you first need to do is create an actionscript 3.0 document, this will verify that computer can handle what you'd really enjoy doing.  Has that been done? Yes? Good, now go over to the issue and see if it has been fixed, if it hasn't then don't worry it will be fixed sooner than you can spell "ApplicationDirectory".  Now go over to the applicationdirectory, right click, go to "properties" click "edit" and check the box that says "allow opening of pdf"  If the checkbox isn't there it is because you may be running on the wrong version, you need the updated version to be able to see the checkbox.  So to update your device go into "settings" click on "verify device" and it will tell you if you need to update which of course, the answer is yes.  So click on "update" and go back to the applicationDirectory. There you go!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 01, 2018 Nov 01, 2018

Copy link to clipboard

Copied

This is not for ActionScript or iOS

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 05, 2018 Nov 05, 2018

Copy link to clipboard

Copied

I've found some success with Adobes DataShare ANE. I will continue to update this post with what I come up with

https://www.adobe.com/devnet/air/articles/datashare-native-extension.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2018 Nov 06, 2018

Copy link to clipboard

Copied

Hi.

The last time I needed to load PDFs on mobile devices using AIR I soon found out that these app stores are becoming each time more restrictive.

What worked for me was to load the PDFs inside of a web view using a service like Google Drive.

I'm not sure if this is what you want or if this is gonna work but I think it's worth trying or maybe at least considering this method as a future alternative.

Also, I don't have a iOS device right now to test the code. I only tested on my PC desktop and on my Android phone.

AS3 code:

import flash.geom.Rectangle;

import flash.events.Event;

import flash.media.StageWebView;

import flash.system.Capabilities;

const GOOGLE_DRIVE_VIEWER:String = "https://drive.google.com/viewerng/viewer?embedded=true&url=";

var webView:StageWebView;

function loadPDF(pdfURL:String,  area:Rectangle = null):void

{

    if (!area)

          area = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);

    webView = new StageWebView(true);

    webView.stage = stage;

    webView.addEventListener(Event.COMPLETE, function(e:Event):void

    {

          webView.viewPort = area;

          e.currentTarget.removeEventListener(e.type, arguments.callee);

    });

    webView.loadURL(isMobile() ? GOOGLE_DRIVE_VIEWER + pdfURL : pdfURL);

}

function isAndroid():Boolean

{

     return (Capabilities.version.substr(0,3) == "AND");

}

function isIOS():Boolean

{

     return (Capabilities.version.substr(0,3) == "IOS");

}

function isMobile():Boolean

{

     return (isAndroid() || isIOS());

}

loadPDF("http://joaocesar.000webhostapp.com/adobe/test/test.pdf");

FLA download:

animate_cc_as3_load_pdf_using_google_drive.zip - Google Drive​

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 06, 2018 Nov 06, 2018

Copy link to clipboard

Copied

Thanks João

I will see if I can adapt it to work on iPad. if it works then mission complete.

I was also looking at an ANE but it appears to have issues with compiling

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 06, 2018 Nov 06, 2018

Copy link to clipboard

Copied

LATEST

Ok so I was able to get the app to interface with the iOS Share mode. Creating a PDF seems to work but copy to iBooks does not

I used the following ANE which is not listed on the ANE directory on the Adobe site but appears to work no problems

GitHub - katopz/ane-device-file-util: ANE 64-bit for open file with registered application on iOS

Make sure you are running the newest version of iOS and AIR SDK

Big thanks to JoãoCésar for his help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines