tags:

views:

2513

answers:

5

I'm looking at ways to embed PDF viewing in a Flex application.

Currently the only option I've seen is by using the flash.html.HTMLLoader class, which only works if you're using AIR. This isn't a big deal -- I'm willing to use AIR if I have to -- but based on my experimentation with viewing a PDF this way it appears that AIR simply integrates the embedded Adobe PDF browser Plug-in for viewing, which not only shows the PDF page(s), but provides all of the manipulation controls as well (zooming, printing, etc.) which I don't want to see.

I'm looking for something that works somewhat along the lines of the JPedal library for Java -- an embedded component that simply renders the PDF alone. Has anyone found a way to do this with either AIR's built-in component or via some other method?

A: 

Take a look at http://www.adobe.com/devnet/flex/quickstart/embedding_assets/ and see if it helps.

I don't think you can embed PDF files directly (but I'm not really sure) but if you totally need to do it and you don't want to open a new window you could convert the PDF to another format that can be inserted in your app.

Federico Builes
+2  A: 

There are a couple of ways, but neither actually have the PDF in the Flex App:

  1. Convert the PDF to SWF. Use this tool or one like it to convert the file over.
  2. Use HTMLComponent, a method that uses an iframe over your flash/flex to make it appear like an external page is in your app. There are a few downsides to this method however - most of them described in detail at Deitte.com.
81bronco
A: 

If your goal is to simply display the PDF in the Flex environment then you could use the IFrame approach. You can find an example here http://www.deitte.com/archives/2006/08/finally_updated.htm

By using this approach you can load any HTML content which includes PDF's.

Take a look.

A: 

Okay guys here is the exact one we're looking

http://subinsugunan.blogspot.com/2009/06/embed-pdf-in-flex-application.html

+1  A: 

What you want is possible with AIR and described in this Adobe article: http://www.adobe.com/devnet/air/flex/quickstart/scripting_pdf.html

Karl Sigiscar
This link is now dead.
Vikas