Share Posted May 7, 2013 Hello,I need load PDF file and show as bitmap in Flash (AS3).I found this code in documentation, but I don´t know how transform byteArray to bitmap? Can somebody help me please? var loader:BinaryDataLoader = new BinaryDataLoader("files/dum.pdf",{name:"filePDF",requireWithRoot:this.root,estimatedBytes:6800}); loader.load(); var files:Array = ["files/dum.pdf"]; LoaderMax.registerFileType("pdf", BinaryDataLoader); LoaderMax.activate([binaryDataLoader]); var queue:LoaderMax = LoaderMax.parse(files,{onProgress:progressHandler,onComplete:completeHandler,onChildFail:childFailHandler}); queue.load(); function completeHandler(event:LoaderEvent):void { var byteArray:ByteArray = LoaderMax.getContent("filePDF"); // I need bitmap from the PDF file ??? } ... Link to comment Share on other sites More sharing options...
Share Posted May 7, 2013 I'm not familiar with any ways to convert a PDF into a Bitmap inside the Flash Player at runtime. Sorry. That's definitely not something LoaderMax handles Link to comment Share on other sites More sharing options...
Author Share Posted May 9, 2013 And is there way how to show loaded PDF file? Link to comment Share on other sites More sharing options...
Share Posted May 9, 2013 Not that I'm aware of, but I'd recommend Googling that because there may be a solution (I just have never heard of one). Link to comment Share on other sites More sharing options...
Share Posted February 12, 2014 Best way i've seen is to open PDF in Illustrator, as as an .AI or .EPS, then import that into Flash. Keep it vector based if your PDF is not rasterized. If so, then save your PDF as a .jpg. Link to comment Share on other sites More sharing options...
Share Posted February 27, 2014 Hey mate, Directly loading a PDF is not possible in Flash for a multitude of reasons. There are some other options however if you only working with Flash. PDF2SWF: http://www.swftools.org/ Converts a PDF document to SWF pages which you can use in oyur app. Havn't tried this one personally but you might get some milage out of it. If however you are using Adobe AIR, you can load your PDF into a HTML Container and then assuming the system that is running your app has adobe reader installed. It should render the PDF. var request:URLRequest = new URLRequest("mydoc.pdf"); pdf = new HTMLLoader(); pdf.load(request); container.addChild(pdf); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now