public class WordApp extends AbstractMicrosoftOfficeApp
app, OFFICE_POSTFIXS
构造器和说明 |
---|
WordApp()
创建Word应用程序
|
限定符和类型 | 方法和说明 |
---|---|
protected void |
doConvert(File officeFile,
File destFile)
执行把office文档转换成目标文档
|
protected void |
initialize()
初始化应用
|
void |
inputTableCellContent(Document doc,
int tableIndex,
int cellRowIndex,
int cellColIndex,
String content)
往文档指定表格指定单元格录入数据
|
void |
insertImageAtTextMark(String textMark,
File imageFile)
在指定文本标签处插入图片
|
Document |
openExistDocument(File officeFile)
打开一个已存在的文档
|
void |
replaceDocText(LinkedHashMap<String,String> texts)
替换文档正文中的文本
|
void |
replaceHeaderFooterText(Document doc,
LinkedHashMap<String,String> texts)
替换文档的页眉与页脚中的文本
|
convert, quit
protected void initialize()
AbstractMicrosoftOfficeApp
initialize
在类中 AbstractMicrosoftOfficeApp
protected void doConvert(File officeFile, File destFile)
AbstractMicrosoftOfficeApp
doConvert
在类中 AbstractMicrosoftOfficeApp
officeFile
- office文档destFile
- 目标文档,目前仅支持PDF和HTMLpublic Document openExistDocument(File officeFile)
AbstractMicrosoftOfficeApp
openExistDocument
在类中 AbstractMicrosoftOfficeApp
officeFile
- office文档public void replaceHeaderFooterText(Document doc, LinkedHashMap<String,String> texts)
doc
- 待处理的文档texts
- 文本数据public void replaceDocText(LinkedHashMap<String,String> texts)
texts
- 文本数据public void inputTableCellContent(Document doc, int tableIndex, int cellRowIndex, int cellColIndex, String content)
doc
- 待处理的文档tableIndex
- 表格索引,从1开始cellRowIndex
- 行索引,从1开始cellColIndex
- 列索引,从1开始content
- 文本值