load the PDF file inside the application (Android and Ipad)

You want to open the PDF file inside the application. I try this code, his work in the PC but when I publish, in the form of APK file it does not work in my android device

package {}

to import flash.display.SimpleButton;

import flash.events.MouseEvent;

import flash.events.Event;

import flash.html.HTMLLoader;

import flash.net.URLRequest;

public class bpdf extends SimpleButton {}

public void bpdf() {}

the constructor code

this.addEventListener (MouseEvent.MOUSE_DOWN, downF);

}

private void downF(e:Event):void {}

var htm:HTMLLoader = new HTMLLoader();

htm. Load (new URLRequest ("test.pdf"));

htm. Width = 200;

htm. Height = 300;

htm.x = 50;

htm.y = 20;

this.parent.addChild (htm);

Create a close button for htm and Add (for this.parent) and its listener here

}

function onCloseEvent(e:Event) {}

If (!.) HTMLLoader.isSupported) {}

This.Alpha =. 1;

}

}

}

}

01.jpg

02.jpg

use:

import flash.media.StageWebView;

import flash.geom.Rectangle;

import flash.desktop.NativeApplication;

import flash.events.MouseEvent;

import flash.filesystem.File;

swv var: StageWebView = new StageWebView();

swv.viewPort = new Rectangle (0, 0, 500, 250); 500px width, height 450px

SWV.stage = this.stage; step StageWebView document class

var templateFile:File = File.applicationDirectory.resolvePath ("test.pdf");

var workingFile:File = File.createTempFile ();

templateFile.copyTo (workingFile, true);

try {}

swv.loadURL (workingFile.url);

} catch (error) {}

trace (e);

}

Tags: Adobe Animate

Similar Questions

Maybe you are looking for