PDA

View Full Version : Open PDF in a component within the current window.


Rish
06-17-2009, 11:08 PM
Hello All,

I am using Flex3.4
I need to open a PDF (which is on the server) in a panel or some component in a flex application window. I am trying to use the 'navigateToURL' function but the '_self' option opens the PDF in the entire current window. I want to open the PDF inside a canvas or panel within the current window and still have other components on current screen to be displayed.
The goal is that the user should be able to see the pdf in a part of the screen and type in comments in a textbox in the same screen.

Please let me know if this be done? If yes, how?

Please let me know if anyone has any sugesstions.
Thanks!

Rishi

Inigoesdr
06-18-2009, 04:45 AM
I don't believe that is possible with Flex. Your options would be:

do it in AIR
Pop up an IFrame over your Flex app to show the PDF; come up with a creative way to pass data back and forth
Convert the PDF to Flash Paper and embed it in your app.. then you could get your desired effect of embedding the document in a Panel/etc.
Port your document to native Flex components, and just put the fields in your Panel

Rish
06-18-2009, 07:34 PM
Thank you Inigoesdr!

The option of converting the PDF to Flash Paper and embedding it in the app sounds best for my app.
I tried to look for ways to do this but not so sure how to do this. The PDF file will be on the server. How can I convert it to Flash Paper at runtime? Is there an API I can use to do this programmatically?
Please let me know your suggestions.

Thanks a lot!
-rish

Inigoesdr
06-20-2009, 05:21 PM
I haven't heard of any on-the-fly conversion software for converting PDF to FlashPaper, though it should be possible to make one fairly easily if you have a Windows VPS. You usually convert it ahead of time, and embed the FlashPaper SWF in your Flex app when you compile it.