Obto
Obto

Reputation: 1417

AS3 - Loading PDFs Into Flash

In my application I need to load PDFs dynamically and store each page of the PDF.

Currently what I'm doing is converting each page to an image using some php code and then importing each image to flash, but I was wondering if there is a better way.

Any ideas? Or is converting to images then importing to flash the best option?

Upvotes: 0

Views: 3827

Answers (2)

greggreg
greggreg

Reputation: 12085

Theres no built in way to decode or display pdfs in flash. Putting that into the plugin would make the initial download larger. It's the same reason why every flex sdk isn't included in the flash plugin download. The best way to emulate this functionality would be to convert the pdf to a swf on the server and load the swf into your application. You can use the GPL project pdf2swf found here http://www.swftools.org/ . Each page of the pdf becomes a frame of the swf and text/images/tables are maintained.

But if by 'better way' you meant more native way then no, there is not a better way than conversion.

Upvotes: 2

Manu Clementz
Manu Clementz

Reputation: 1797

I had a similar issue recently, and used the same solution : pdf to image conversion. I still don't understand why Adobe didn't add some pdf import capabilities to Flash. I believe that it's your only option if you need to load your files dynamically.

Upvotes: 0

Related Questions