永发信息网

求一款android平台上的doc、docx阅读软件

答案:3  悬赏:80  手机版
解决时间 2021-03-19 02:32
不需要编辑,能阅读就行,最好能修改字体。wps除外。
最佳答案
目前就WPS好用,其他的都不行,是因为WPS占内存太多吧。你在网上找找金软office,最好能找到无广告的
全部回答
解析doc,要tm-extractors-0.4.jar这个包解析xls,要jxl.jar这个包        解析xls 解析docx 01    public static string readdocx(string path) {     02                    string river = "";     03                    try {     04                            zipfile xlsxfile = new zipfile(new file(path));     05                            zipentry sharedstringxml = xlsxfile.getentry("word/document.xml");     06                            inputstream inputstream = xlsxfile.getinputstream(sharedstringxml);     07                            xmlpullparser xmlparser = xml.newpullparser();     08                            xmlparser.setinput(inputstream, "utf-8");     09                            int evttype = xmlparser.geteventtype();     10                            while (evttype != xmlpullparser.end_document) {     11                                    switch (evttype) {     12                                    case xmlpullparser.start_tag:     13                                            string tag = xmlparser.getname();     14                                            system.out.println(tag);     15                                            if (tag.equalsignorecase("t")) {     16                                                    river += xmlparser.nexttext() + "\n";     17                                            }     18                                            break;     19                                    case xmlpullparser.end_tag:     20                                            break;     21                                    default:     22                                            break;     23                                    }     24                                    evttype = xmlparser.next();     25                            }     26                    } catch (zipexception e) {     27                            e.printstacktrace();     28                    } catch (ioexception e) {     29                            e.printstacktrace();     30                    } catch (xmlpullparserexception e) {     31                            e.printstacktrace();     32                    }     33                    if (river == null) {     34                            river = "解析文件出现问题";     35                    }     36          37                    return river;     38            }             解析xlsx 01    public static string readxlsx(string path) {     02                    string str = "";     03                    string v = null;     04                    boolean flat = false;     05                    list ls = new arraylist();     06                    try {     07                            zipfile xlsxfile = new zipfile(new file(path));     08                            zipentry sharedstringxml = xlsxfile     09                                            .getentry("xl/sharedstrings.xml");     10                            inputstream inputstream = xlsxfile.getinputstream(sharedstringxml);     11                            xmlpullparser xmlparser = xml.newpullparser();     12                            xmlparser.setinput(inputstream, "utf-8");     13                            int evttype = xmlparser.geteventtype();     14                            while (evttype != xmlpullparser.end_document) {     15                                    switch (evttype) {     16                                    case xmlpullparser.start_tag:     17                                            string tag = xmlparser.getname();     18                                            if (tag.equalsignorecase("t")) {     19                                                    ls.add(xmlparser.nexttext());     20                                            }     21                                            break;     22                                    case xmlpullparser.end_tag:     23                                            break;     24                                    default:     25                                            break;     26                                    }     27                                    evttype = xmlparser.next();     28                            }     29                            zipentry sheetxml = xlsxfile.getentry("xl/worksheets/sheet1.xml");     30                            inputstream inputstreamsheet = xlsxfile.getinputstream(sheetxml);     31                            xmlpullparser xmlparsersheet = xml.newpullparser();     32                            xmlparsersheet.setinput(inputstreamsheet, "utf-8");     33                            int evttypesheet = xmlparsersheet.geteventtype();     34                            while (evttypesheet != xmlpullparser.end_document) {     35                                    switch (evttypesheet) {     36                                    case xmlpullparser.start_tag:     37                                            string tag = xmlparsersheet.getname();     38                                            if (tag.equalsignorecase("row")) {     39                                            } else if (tag.equalsignorecase("c")) {     40                                                    string t = xmlparsersheet.getattributevalue(null, "t");     41                                                    if (t != null) {     42                                                            flat = true;     43                                                            system.out.println(flat + "有");     44                                                    } else {     45                                                            system.out.println(flat + "没有");     46                                                            flat = false;     47                                                    }     48                                            } else if (tag.equalsignorecase("v")) {     49                                                    v = xmlparsersheet.nexttext();     50                                                    if (v != null) {     51                                                            if (flat) {     52                                                                    str += ls.get(integer.parseint(v)) + "  ";     53                                                            } else {     54                                                                    str += v + "  ";     55                                                            }     56                                                    }     57                                            }     58                                            break;     59                                    case xmlpullparser.end_tag:     60                                            if (xmlparsersheet.getname().equalsignorecase("row")     61                                                            && v != null) {     62                                                    str += "\n";     63                                            }     64                                            break;     65                                    }     66                                    evttypesheet = xmlparsersheet.next();     67                            }     68                            system.out.println(str);     69                    } catch (zipexception e) {     70                            e.printstacktrace();     71                    } catch (ioexception e) {     72                            e.printstacktrace();     73                    } catch (xmlpullparserexception e) {     74                            e.printstacktrace();     75                    }     76                    if (str == null) {     77                            str = "解析文件出现问题";     78                    }     79          80                    return str;     81            }
openoffice libreoffice(开源的) Documents to go
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
大家东西朝向的房子好不好
平山县外国语中学地址在哪,我要去那里办事
女朋友养的兔子死了,她很伤心,有什么好办法
男生的斜刘海是剪的一边高一边低的还是一大把
有谁知道66枝红玫瑰代表什么意思吗?
惠缘理发地址在什么地方,我要处理点事!
出轨男人的自白和保证是应该信还是不信
广西太华医药有限公司灵山分公司陆屋配送中心
关于澳门城市大学先修班
青瓜和百香果可以同时吃?
为什么 hadoop hdfs 写入速度那么慢
请问广州省汽车站到惠阳淡水的汽车在淡水的那
我看上一个小护士,怎么泡她,高人来
玉树冬天可以放室内吗?
我的世界xray怎么用 矿物透视mod怎么用
推荐资讯
金川娃麻辣烫地址有知道的么?有点事想过去
西安咸阳机场的大巴开到几点?
c语言怎么实现获取桌面路径
牧龙河大桥在什么地方啊,我要过去处理事情
两家私人超市恶意降价怎么办?
六房头我想知道这个在什么地方
余光眼不敢从别人旁边经过,怕别人误会。觉得
先凡文体总汇地址在哪,我要去那里办事
安子村我想知道这个在什么地方
在传统的Windows应用程序里,线程thread、窗
夫妻离婚协议房子归一方所有,另一方没有住房
开机等待时间长我选择了有选择启动,可是点了
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?