我下载了Apache HWPF。我想用它来读取 doc 文件并将其文本写入纯文本文件。我不太了解HWPF。
我非常简单的程序在这里:
我现在有3个问题:
一些包有错误(他们找不到 apache hdf)。我该如何修复它们?
如何使用 HWDF 的方法来查找和提取图像?
我的程序的某些部分不完整且不正确。所以请帮我完成它。
我必须在 2 天内完成这个程序。
我再次重复请帮助我完成这个。
非常感谢你们的帮助!!!
这是我的基本代码:
public class test {
public void m1 (){
String filesname = "Hello.doc";
POIFSFileSystem fs = null;
fs = new POIFSFileSystem(new FileInputStream(filesname );
HWPFDocument doc = new HWPFDocument(fs);
WordExtractor we = new WordExtractor(doc);
String str = we.getText() ;
String[] paragraphs = we.getParagraphText();
Picture pic = new Picture(. . .) ;
pic.writeImageContent( . . . ) ;
PicturesTable picTable = new PicturesTable( . . . ) ;
if ( picTable.hasPicture( . . . ) ){
picTable.extractPicture(..., ...);
picTable.getAllPictures() ;
}
}