Portable RIAs – Flex Apps in PDFs

The web began as a platform for browsing, finding, and exchanging documents. Over the past ten years the web has moved beyond this document-centric role, and is now a platform for exchanging data. We typically refer to web sites used for data exchange as web applications. The next major evolution of the web is underway as web applications become more interactive and useful. The industry now refers to these next generation web applications as rich Internet applications or RIAs.

Another popular means of document exchange is the Portable Document Format (PDF). Like the web, PDFs are also evolving into more than just a document exchange technology. When RIAs are inserted into PDFs, this familiar format for documents becomes a method for exchanging and interacting with data. The primary benefits of using PDFs for data exchange are that PDFs can easily be secured, emailed around, and accessed when offline.

I’ve put together a demo illustrating this concept. You will need Reader 9 in order for this to work. First load the Flex Dashboard application application in your browser. Then in the application click the “Create PDF” button. Now you should be looking at the same data inside of a PDF! You can even save the PDF locally and view it when disconnected. You can also refresh the data from the server from the PDF or from the browser.

This works by using a template PDF containing the Flex application without any data. When the user asks for a PDF the data is inserted into the PDF template and delivered to the user. Optionally the PDF could be secured with PDF policy protection before being sent to the user. You can also create these PDFs in a nightly batch process.

For an in-depth tutorial of how I created this demo click here.

19 Responses to “Portable RIAs – Flex Apps in PDFs”

  1. Brian writes:

    Looks interesting however I receive an error when clicking the Create PDF button.

    HTTP Status 404 -
    type Status report
    message
    description The requested resource () is not available.
    Apache Tomcat/5.5.17

  2. James Ward writes:

    Hi Brian,

    That is strange. What url does it say it’s trying to access? Thanks.

    -James

  3. Email an Interactive Dashboard? | Model Metrics writes:

    [...] can learn more here by checking out Jame’s blog [...]

  4. David R writes:

    Cool idea, but unfortunately does not work with Foxit PDF Reader under Windows or evince(default PDF reader that got installed for me) under Linux. So it pretty much cancels out the idea of ‘Portable’.

  5. Moxie writes:

    This is a very interesting way of delivering dynamic data using proven and traditional (aka good-n-old) media. I guess PDF is one of such media. If get it styled more naturally like a embedded picture but can interactive, that will be very cool.

  6. Kazi writes:

    Hi James, the RIA cowboy,

    it is nice to see that you are aging posting in
    your blog. Last few months I was visiting your
    blog regularly and did not find that much postings.
    It was depressing for me :-(. Any way I really like
    your tutorials, examples and postings so always
    look forward to see new ones!!!

    Regards…..

  7. James Ward writes:

    Hi David,

    There is nothing stopping Foxit, Evince and others from supporting Flash in PDFs. I hope that they will soon update their implementations to support this. Until then there is Adobe Reader 9 – which has been greatly improved over the slow loading, bloated software it used to be.

    -James

  8. Funkyboy writes:

    I get a blank PDF (on the background the text “LiveCycle
    Data Services
    Single CPU License”).

    The url is: http://www.jamesward.com/portablerias/dynamic-pdf?id=E2A590A3-510D-44A1-5E1A-D01567F1B604&;jsessionid=742CAF69679082BCE27811BB3BA52533

  9. James Ward writes:

    Hi Funkyboy,

    You need to have Reader 9 or Acrobat 9 for this to work.

    -James

  10. Touch My Blog | Embedding Flash and Flex Apps in a PDF writes:

    [...] Check it out Categories : Uncategorized trackback comments rss [...]

  11. Flex Monkey Patches » Blog Archive » Rubbernecker’s Review - Week 20 writes:

    [...] Portable RIAs – Flex Apps in PDFs (from James Ward – RIA Cowboy) [...]

  12. Flex Applications In PDFs | 4xPDF writes:

    [...] This is pretty cool: Flex applications embedded in PDFs. When I first saw all of the new Flash and multimedia features announced in Acrobat 9 I was fairly dismissive, but recently I’ve seen some great work that people have been able to do because of these new features — so I’m a lot less skeptical now. [...]

  13. Vineet Apte writes:

    Hey James,
    when I click th create pdf button nothing happens. I tried to refresh and reload the page still the same result. I get no error. I do have reader 9.
    Advice what to do

    Vineet

  14. James Ward writes:

    Hi Vineet,

    Make sure you don’t have a pop-up blocker prohibiting the pop-up.

    -James

  15. Jeremy Chone writes:

    This is really really cool!

  16. Francesco Cavola writes:

    Hi James. Very nice work. There is a possible to create a similar pdf with flex components but on the server side, in batch mode?

  17. James Ward writes:

    Hi Francesco,

    You will want to build a Flex app and then assemble the PDF on the server in a batch process.

    -James

  18. Stephen writes:

    I know this is completely backwards from your tutorial, but I haven’t gotten a good answer in any more logical places so… I want build a Flex app that lets users review and comment on PDFs. It needs to be web-based, and the way users interact with the document is permission-controlled beyond what normal PDF review tools allow. FlashPaper looks like it would have been a cool alternative, but it is eod. Any suggestions of where to look for interacting with PDFs within Flex? Thank you for the help!

  19. James Ward writes:

    Hi Stephen,

    There are a few commercial components out there for rendering PDFs in Flex. Another option is to use AIR.

    -James

Leave a Reply