I would like to develop an app for printing service in Windows Phone 7. In the app, the users can select file to print out. Is there any way to open docx, xlsx, etc. in WP7 programmatic开发者_Python百科ally? I know in iPhone the WebView supports to view many file types. Is there anything similar in WP7?
If you are looking to open the document in Office, try using the WebBrowserTask
to navigate to the document. There's a good chance it will open with Office.
If you want to render the document yourself, you are very much out of luck. You could try navigating to the document in a WebBrowser control, but I don't think it's supported.
Besides, there are no printing APIs so there would be no way to print it. If this is an enterprise application (ie. internal to your company), you might consider writing a web service on a local server that can accept DOCX files and print them. You could then call that service from your app to print the docs.
You will not be able to open these types of files from the isolated storage. There is no way for third-party applications to launch the external application required for viewing these file types. All of the files which you have listed in your question are XML-based open source file formats. Depending on how much time you want to spend on this, you could write your own parser or possibly utilize an open-source or commercial one.
精彩评论