Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
368 views
in Technique[技术] by (71.8m points)

android - Docx conversion

I am doing simple docx conversion app in android.

File file = new File(path + "Sample1.docx");
FileInputStream fis = new FileInputStream(file);

 XWPFDocument document = new XWPFDocument( fis);
 XWPFWordExtractor extractor = new XWPFWordExtractor(document);  
 String docText = extractor.getText(); 

Added the above line in my onCreate method.

Included dom4j,poi3.8,poi-ooxml3.8,poi-xml-schema3.8 & xmlbeans jars in libs folder.

When i run this i got the error Unable to execute dex: method ID not in [0, 0xffff]: 65536

Googled and i got the info about converting jar to dex.

With out dex is that possible docx reading? Even i dont want xlsx & pptx packages of poi.

I want covert only doc and docx file. Is there any separate code for only doc&docx conversion.

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I was able to make JWord working under Android. Had many issues with Apache POI like you have (Conversion to Dalvik format failed).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...