Displaying Google Docs or Microsoft Office files in a Flex app?

Hey everyone, I’m trying to figure out how to show Google Docs or Microsoft Office files (like Word or PowerPoint) inside a Flex application. I’m working on both mobile and web versions.

For Google Docs, I’m thinking maybe there’s an HTML component with JavaScript support that could work? Does anyone know if Flex 4 or newer has something like this?

As for Word and PowerPoint files, I’m not sure where to start. Has anyone done this before? I’ve seen sites like SlideShare and Scribd display these kinds of files, but I’m not sure how they manage it.

Any tips or suggestions would be really helpful. Thanks!

Having worked on a similar project, I can share some insights. For Google Docs, the Google Docs Embed API is a robust solution. It’s more flexible than the Viewer and integrates seamlessly with Flex applications. You’ll need to handle authentication carefully, though.

For Microsoft Office files, we found success using Apache POI on the server-side to convert documents to HTML. This approach allowed us to maintain formatting better than PDF conversion. We then used a custom HTML component in Flex to display the content.

Keep in mind that both solutions require careful consideration of performance, especially for large files or when dealing with many documents simultaneously. Caching converted files and implementing lazy loading can significantly improve user experience, particularly on mobile devices with limited resources.

I’ve actually tackled a similar challenge in one of my recent projects. For Google Docs, we ended up using the Google Docs Viewer API. It’s pretty straightforward to implement and works well within a Flex application. You essentially create an iframe and load the Google Docs Viewer URL with your document’s URL as a parameter.

As for Microsoft Office files, we found that converting them to PDF format on the server-side and then using a PDF viewer component in Flex was the most reliable approach. There are several PDF viewers available for Flex, like FlexPaper or PDF.js, that can be integrated relatively easily.

One thing to keep in mind is that these solutions may require some additional server-side processing, especially for the Office files. Also, make sure you’re handling any potential security concerns, particularly if you’re dealing with sensitive documents. It took some trial and error, but we got it working smoothly in both our web and mobile versions.

hey, for google docs u could try the embed api. it’s pretty neat. for ms office stuff, maybe look into using a converter lib on ur server to change them to html? then u can show that in flex. just watch out for big files, they might slow things down. good luck!