public class Document extends Instance
构造器和说明 |
---|
Document(com.jacob.activeX.ActiveXComponent app,
com.jacob.com.Dispatch dispatch) |
限定符和类型 | 方法和说明 |
---|---|
void |
addTableRow(int tableIndex,
int rowIndex)
在指定行前面增加行
|
void |
close()
关闭文档
|
void |
doSaveAsHtml(String htmlFilePath)
文档保存为html
|
void |
doSaveAsPdf(String pdfFilePath)
文档保存为pdf
|
String |
getContentFromCell(int tableIndex,
int cellRowIndex,
int cellColIndex)
获取文档内对应表格对应单元格的内容
|
void |
insertImageAtBookMark(String bookmarkName,
File imageFile)
在指定书签插入图片
|
void |
mergeCell(int tableIndex,
int cellRowFromIndex,
int cellColFromIndex,
int cellRowToIndex,
int cellColToIndex)
合并表格指定区域的单元格
|
void |
save()
保存文档更改的内容
|
void |
saveAs(String filePathName)
文档另存为到新的地址
|
saveAsHtml, saveAsPdf
getDispatch
public Document(com.jacob.activeX.ActiveXComponent app, com.jacob.com.Dispatch dispatch)
public void doSaveAsHtml(String htmlFilePath)
Instance
doSaveAsHtml
在类中 Instance
htmlFilePath
- html文档地址public void doSaveAsPdf(String pdfFilePath)
Instance
doSaveAsPdf
在类中 Instance
pdfFilePath
- pdf文档地址public String getContentFromCell(int tableIndex, int cellRowIndex, int cellColIndex)
tableIndex
- 表格索引,从1开始cellRowIndex
- 行索引,从1开始cellColIndex
- 列索引,从1开始public void addTableRow(int tableIndex, int rowIndex)
tableIndex
- 表格索引,从1开始rowIndex
- 行索引,从1开始public void mergeCell(int tableIndex, int cellRowFromIndex, int cellColFromIndex, int cellRowToIndex, int cellColToIndex)
tableIndex
- 表格索引,从1开始cellRowFromIndex
- 起始单元格行索引,从1开始cellColFromIndex
- 起始单元格列索引,从1开始cellRowToIndex
- 目标单元格行索引,从1开始cellColToIndex
- 目标单元格列索引,从1开始