jacob把word转换html时图片生成路径问题
请问利用jacob把word转换成html页面的时候怎么把图片的路径生成为绝对路径?我的代码如下,请各位大侠告诉我在哪里设置一下图片的路径生成方式:
// 把word文档转换成为HTML,docfile为word文档绝对路径,htmlfile为生成的html页面绝对路径
public void change(String docfile, String htmlfile) {
ActiveXComponent app = new ActiveXComponent("Word.Application"); // 启动word
try {
app.setProperty("Visible", new Variant(false));
// 设置word不可见
Dispatch docs = app.getProperty("Documents").toDispatch();
Dispatch doc = Dispatch.invoke(docs,"Open",Dispatch.Method,
new Object[] { docfile, new Variant(false),
new Variant(true) }, new int[1]).toDispatch();
// 打开word文件
Dispatch.invoke(doc, "SaveAs", Dispatch.Method, new Object[] {
htmlfile, new Variant(8) }, new int[1]);
// 作为html格式保存到临时文件
Variant f = new Variant(false);
Dispatch.call(doc, "Close", f);
} catch (Exception e) {
e.printStackTrace();
} finally {
app.invoke("Quit", new Variant[] {});
}
}