LiveCycle Enterprise Suite provides capabilites and services for developing easily a client application especially by using Flex. In our case, LiveCycle Content Services module has been installed and then contents, each of which is a PDF document, are needed to be uploaded to the content space. Briefly the usage scenario is that an user is only responsible for uploading original document and the another user is responsible to view the document content and add metadata information for it. At Content Services module side, we have developed a custom content model and alfresco application module package(AMP) for handling domain specific metadata information. At user side, we have developed a client application with Flex 4 by using remote services of LiveCycle server.
The main problem with Flex client application was that displaying PDF document in a popup window. I have read almost every articles about displaying PDF in Flex application and then I realized that the best way to achieve the same is using google’s iframe component. But, the problem about iframe was that it crashes once direct URL of PDF document is assigned as its source. So as required in the usage scenario, PDF documents are the contents stored in the system and they should be viewed directly. Generally, the solution is that using a temprorary HTML, which gets rendered to initialize Iframe instance, and then the direct URL of PDF can be provided as its source. Please find the solution’s detail below.
- Define an IFrame instance in Flex by making it disabled.
<flexiframe:IFrame id="iframe" source="docViewer.html" backgroundColor="gray" width="100%" height="100%" visible="false"/>
- Generate an HTML resource by including only a couple of mandatory HTML tags
<html>
<body>
<h1>Creasis - HTML Test</h1>
</body>
</html>
- Develop a popup window function to display IFrame instance
private function showDocumentAction(doclink:String):void {
var showContDoc:DocumentViewer=DocumentViewer(PopUpManager.createPopUp(
this, DocumentViewer , true) as spark.components.TitleWindow);
showContDoc.addElement(outerDocument.iframe);
outerDocument.iframe.visible = true;
outerDocument.iframe.source = doclink
}
<s:Button label="Show Doc" width="75" click="showDocumentAction(data.documentLink)"/>
As you can easily see that, temprorary HTML resource is just used to help rendering IFrame instance. So the solution can be thought as ineffecient one and it will be invalid once the IFrame is improved for displaying PDF’s URL directly. I also aggree with the idea that IFrame should not be used for displaying a document within Flex application. To overcome such problems, AIR based client application should be considered seriously.
Relevant Posts:

Interesting layout on your blog. I really enjoyed reading it and also I will be back to read more in the future.
I’ve seen progression in every post. Your newer posts are simply wonderful compared to your posts in the past. Keep up the good work!
I just added to favorites your post. Interesting read.
When we talk about such things we usually forgot many things about that and people should read this to get more information about it.
Thanks I really needed this.
I would like to thank you for the efforts you have made in composing this post. I am going for the same best work from you in the future as well. In fact your fanciful writing abilities has prompted me to start my own blog now. Actually the blogging is spreading its wings rapidly. Your write up is a fine example of it.
Hmm, your site took quite a long time to load but it was worth it.
Hi everybody. Fascinating topic for any weblog. I was just surfing the Internet for fun when I discovered your website. Fabulous post. Thanks a ton for sharing your thoughts!
Good day I was fortunate to look for your blog in google
your Topics is outstanding
I learn much in your website really thank your very much
btw the theme of you site is really outstanding
where can find it
Awesome blog thanks for your time.
Yeah, thanks for sharing all this informations, and thanks for this article.
Way to focus and straight to your point, i love it. Keep up the work people. Dont let anyone stop us bloggers.
It is truely interesting post, but I do not see everything completely clear, especially for someone not involved in that topic. Anyway very interesting to me.
Wonderfully informative.
It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.
Useful info I was looking for. Thx for the e-publishing!
this post is very usefull thx!
I really enjoyed reading this post. Thank you so much for sharing this information and publishing it.
First-class news it is surely. We’ve been seeking for this content.
Hey…thanks for that. Fantastic content. I’ll be coming back soon for more news. Cheers!
I only wanted to say thanks for your write up.
All I ask is that, once I’ve paid for it (and price isn’t a problem, within reason) I can create what I want. Extensive Google searching has drawn a blank, but maybe I’m using the wrong terms.
Your blog is good! I found it on Yahoo. I think I will come back one day.
very use full information. thank you.
I’d like to thank you for the time you took writing this article. This has been an inspiration for me. I have passed this on to a friend of mine.
It was a really nice thought! Just wanna say thank you for the selective information you have diffused. Just continue writing this kind of post. I will be your loyal reader. Gives Thanks over again.
a very inspiring sroties…great thanx to you and to all the people who develope this site. keep going and good luck.