flex - How can I convert a PDF file to an image? -


I give users the ability to upload an image in my Air app, then displaying this image in image control I am But I have the permission to upload the PDF in the same way, so I have to convert the PDF into an image. I only meditate about the first page of PDF that they upload now

What I'm doing: 1) User browses for a file with file reference control 2) User upload 3) I encode the image on MP3 and store it 4) I then load that base 64 in some way:

  Public function DecodeImage (b64String: String): Zero {var decoder: Base64Decoder = new Ba Se64Decoder (); Decoder.decode (b64String); Var imgLoader: Loader = new loader (); ImgLoader.loadBytes (decoder.toByteArray ()); ImgLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, decodedImageLoaded); } Personal Function Decoded Image Loaded (Event: Event): Zero {var imgLoader: Loader = (event.target as loaderInfo) .loader; Var BMP: bitmap = bitmap (imgLoader.content); ImgLoader.removeEventListener (Event.Complete, Loaded the decoded image); Var img: image = new image (); Img.source = bmp; This.addChild (img); }  

This method is working very well for .gif, .jpg, and .png, at some point in my process, possibly initial uploading to me the first page of the PDF PGI has to be converted so that I can use the rest of the process.

I welcome any idea with the sole requirement that it should be a part of the Air app, I can not use any image magic which runs on the server, but I have a component I can compile in the finished product.

I believe that Elip PDF for Flash now has the ability to read a PDF file. You can try PurePDF, as well. You can potentially use these to get the desired page and convert it to an image.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -