在Android上显示MS文档 [英] Display of MS documents on Android

查看:122
本文介绍了在Android上显示MS文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法显示ppt infact我想在视图中不仅显示ppt而且还显示doc / ppt / pdf / xls文件.....



I am not able to display the ppt infact i want to display not only ppt but also doc/ppt/pdf/xls files in a view.....

final Uri uri = Uri.fromFile(file);
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "application/vnd.ms-powerpoint");

PackageManager pm = getPackageManager();
List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
if(list.size() > 0)
   startActivity(context, intent);



如上所示,代码是在我的Android平板电脑上显示MS ppt。



现在我的代码程序如下。



1.我将从URL下载一个ppt并将其存储在SD卡中。

2.然后我想在一个视图中显示ppt,我认为它完全适用于此。



所以我无法显示ppt infact我想在视图中不仅显示ppt而且还要显示doc / ppt / pdf / xls文件..... />
那么怎么做?????



[Torsten]将标题改为短版本并添加了代码块[/ Torsten]


As you look at the above the code is to display a MS ppt on my android tablet.

Now my code procedure is as follows.

1.I will download a ppt from a URL and store it in sdcard .
2.Then i would like to display the ppt in a view which i duno wich exactly is suitable for this.

So I am not able to display the ppt infact i want to display not only ppt but also doc/ppt/pdf/xls files in a view.....
So how to do it ?????

[Torsten]changed title to a short version and added code block[/Torsten]

推荐答案

嗨sistlachetan,



我想首先,你应该赶上 Java 可以 doc / ppt / pdf / xls 文件进行交互(阅读/修改..)

对于这一点,我建议进行深入研究在 Apache POI [ ^ ]



Apache POI项目的任务是创建和维护Java API,以便根据Office Open XML标准(OOXML)和Microsoft的OLE 2复合文档格式(OLE2)操作各种文件格式。简而言之,您可以使用Java读写MS Excel文件。此外,您还可以使用Java读取和写入MS Word和MS PowerPoint文件。 Apache POI是您的Java Excel解决方案(适用于Excel 97-2008)。我们有一个完整的API用于移植其他OOXML和OLE2格式,并欢迎其他人参与
Hi sistlachetan,

I think firstly, u should catch up how Java can interact(read/modify..) with doc/ppt/pdf/xls files.
For this point, I recommend reserching on Apache POI[^]

"The Apache POI Project''s mission is to create and maintain Java APIs for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft''s OLE 2 Compound Document format (OLE2). In short, you can read and write MS Excel files using Java. In addition, you can read and write MS Word and MS PowerPoint files using Java. Apache POI is your Java Excel solution (for Excel 97-2008). We have a complete API for porting other OOXML and OLE2 formats and welcome others to participate"


这篇关于在Android上显示MS文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆