用户登录
用户注册

分享至

aspose.wordjava

  • 作者: 晗風袭来
  • 来源: 51数据库
  • 2020-04-21

1.如何使用Aspose Words for Java插入条形图

虽然Aspose.Words for Java目前还不允许在Word文档中创建条形图。但是可以通过Aspose.Cells for Java创建静态条形图,并选染成图片,然后再通过Aspose.Words for Java添加到Word文档中:

//Create a new Workbook.

Workbook workbook = new Workbook();

//Get the first worksheet.

Worksheet sheet = workbook.getWorksheets().get(0);

//Set the name of worksheet

sheet.setName("Data");

//Get the cells collection in the sheet.

Cells cells = workbook.getWorksheets().get(0).getCells();

//Put some values into a cells of the Data sheet.

cells.get("A1").setValue("Region");

cells.get("A2").setValue("France");

cells.get("A3").setValue("Germany");

cells.get("A4").setValue("England");

2.Aspose.Words for Java应用之一,word转png怎么去掉水印

对于文档处理控件Aspose.words,它的具有代表性的功能是在没有安装Microsoft Word的情况下,也能实现生成、打印、渲染、邮件合并,文档格式转换等功能。今天在使用Aspose.Words过程中,意外的发现这款文档处理软件的另外一个功能,它可以将图像转换为PDF文件,接下来就为大家分享一下实现这一功能的具体代码

如有疑问追问,如满意记得采纳,

如果有其他问题也可点我名字向我求助

答题不易,

如果没有回答完全,请您谅解,

请采纳最快回答的正确答案!!谢谢!

3.如何用java在本地打开在服务器上的word文档

可以用poi先将word下载到本地,

在用Runtime.getRuntime().exec(); 调用本地文件

package cn.rain.main;

import java.io.File;

import java.io.IOException;

public class TT {

/**

* @param args

*/

public static void main(String[] args) {

try {

Runtime.getRuntime().exec("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE aa.doc");

} catch (IOException e) {

// TODO 自动生成 catch 块

e.printStackTrace();

}

}

}

你的WORD安装路径C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE空格后所加的aa.doc为你的文档文件名(有文件名重复的,可以加路径,写法和安装路径的写法一样)

或者用Runtime.getRuntime().exec("cmd /c \"C:\\temp\\the list.doc\"");

也可以运行

转载请注明出处51数据库 » aspose.wordjava

软件
前端设计
程序设计
Java相关