Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
347 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 Answer

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...