Portable RIAs – Flex Apps in PDFs
Wednesday, 5 November 2008
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.



No. 1 — November 5th, 2008 at 2:44 pm
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
No. 2 — November 5th, 2008 at 3:24 pm
Hi Brian,
That is strange. What url does it say it’s trying to access? Thanks.
-James
No. 3 — November 5th, 2008 at 5:05 pm
[...] can learn more here by checking out Jame’s blog [...]
No. 4 — November 5th, 2008 at 5:42 pm
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’.
No. 5 — November 5th, 2008 at 5:52 pm
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.
No. 6 — November 5th, 2008 at 9:30 pm
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…..
No. 7 — November 5th, 2008 at 9:34 pm
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
No. 8 — November 6th, 2008 at 5:17 am
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
No. 9 — November 6th, 2008 at 6:30 am
Hi Funkyboy,
You need to have Reader 9 or Acrobat 9 for this to work.
-James
No. 10 — November 6th, 2008 at 9:19 am
[...] Check it out Categories : Uncategorized trackback comments rss [...]
No. 11 — November 11th, 2008 at 9:11 am
[...] Portable RIAs – Flex Apps in PDFs (from James Ward – RIA Cowboy) [...]
No. 12 — November 12th, 2008 at 10:16 am
[...] 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. [...]
No. 13 — December 3rd, 2008 at 12:01 am
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
No. 14 — December 3rd, 2008 at 12:55 am
Hi Vineet,
Make sure you don’t have a pop-up blocker prohibiting the pop-up.
-James
No. 15 — December 23rd, 2008 at 9:10 am
This is really really cool!
No. 16 — April 14th, 2009 at 8:01 am
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?
No. 17 — April 14th, 2009 at 9:33 pm
Hi Francesco,
You will want to build a Flex app and then assemble the PDF on the server in a batch process.
-James
No. 18 — May 19th, 2009 at 12:27 pm
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!
No. 19 — June 11th, 2009 at 11:19 am
Hi Stephen,
There are a few commercial components out there for rendering PDFs in Flex. Another option is to use AIR.
-James