如果你是微软office的正版用户肯定是office要好用,因为office是最强大的办公软件。
如果你是盗版的,我个人觉得openoffice好得多,有帮助文档,什么不知道可以查,在安全上不用担心。盗版的office很多功能没有了。盗版的能干的,openoffice也可以干。节省资源的角度当然openoffice更好。
好用的,我一直在用,亲测过的哦,放心使用
1.进入到"OpenOffice"表格工具的操作主界面,新建一个空白文档。
2.在任意一个单元格中,自定义添加文本内容。
3.用"鼠标右键"选中单元格,点击弹出菜单中的"单元格格式(F)..."选项。
4.之后,会弹出"单元格格式"对话框,选择"对齐"菜单栏,勾选中"自动换行(W)"复选框,再点击"确定"按钮应用生效。
5.完成操作后,可将选中的单元格的内容进行自动换行。
可以用写字板打开,复制出来修改格式即可。
卸载的话 你可以直接删除整个文件根目录 然后用超级兔子或者优化大师清理下注册表 和卸载程序一样的效果 如果怕弄坏系统 超级兔子里面有智能卸载 很安全的
需要itext2.1.5,
以下是对pdf加水印的代码,包括文字水印和图片水印
public int fileCopy(String srcPath, String destPath) {
FileOutputStream fos = null;
FileInputStream fis = null;
try {
fos = new FileOutputStream(destPath);
fis = new FileInputStream(srcPath);
byte[] buffer = new byte[1024];
int len = 0;
while ((len = fis.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
return 1;
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
fis.close();
fos.flush();
fos.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return 0;
}
/**
* 为pdf文件加文字水印
*
* @param srcPath
* 源文件路径
* @param destPath
* 目标文件路径
* @param waterText
* 水印文字
* @throws DocumentException
* @throws IOException
*/
public void wordWaterMark(String srcPath, String destPath, String waterText) throws DocumentException, IOException {
int result = fileCopy(srcPath, destPath);
if (result == 1) {
// 待加水印的文件
PdfReader reader = new PdfReader(destPath);
// 加完水印的文件
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(srcPath));
int total = reader.getNumberOfPages() + 1;
PdfContentByte content;
// 设置字体
BaseFont base = BaseFont.createFont(fontPath, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
// 水印文字
int j = waterText.length(); // 文字长度
char c = 0;
int high = 0;// 高度
// 循环对每页插入水印
for (int i = 1; i < total; i++) {
// 水印的起始
high = 60;
content = stamper.getUnderContent(i);
PdfGState gs = new PdfGState();
gs.setFillOpacity(0.1f);// 设置透明度为0.2
content.setGState(gs);
// 开始
content.beginText();
// 设置颜色
// content.setColorFill(new Color());
// 设置字体及字号
content.setFontAndSize(base, 88);
// 设置起始位置
content.setTextMatrix(120, 333);
// 开始写入水印
for (int k = 0; k < j; k++) {
content.setTextRise(high);
c = waterText.charAt(k);
content.showText(c + "");
high += 20;
}
content.endText();
}
stamper.close();
System.out.println("添加成功++++++++++++++++++++++++++++++++++++++++++");
} else {
System.out.println("复制pdf失败====================");
}
}
public void picWaterMark(String srcPath, String destPath, String imageFilePath)
throws DocumentException, IOException {
int result = fileCopy(srcPath, destPath);
if (result == 1) {
// 待加水印的文件
PdfReader reader = new PdfReader(destPath);
// 加完水印的文件
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(srcPath));
Image img = Image.getInstance(imageFilePath);
img.setAbsolutePosition(50, 400);// 坐标
img.setRotation(20);// 旋转 弧度
img.setRotationDegrees(45);// 旋转 角度
// image.scaleAbsolute(200,100);//自定义大小
img.scalePercent(50);// 依照比例缩放
int pageSize = reader.getNumberOfPages();
for (int i = 1; i <= pageSize; i++) {
PdfContentByte under = stamper.getUnderContent(i);
under.addImage(img);
PdfGState gs = new PdfGState();
gs.setFillOpacity(0.2f);// 设置透明度为0.2
under.setGState(gs);
}
stamper.close();// 关闭
System.out.println("添加成功++++++++++++++++++++++++++++++++++++++++++");
} else {
System.out.println("复制pdf失败====================");
}
}
linux下转pdf可以用libreoffice,需要安装,这个是免费的,具体代码如下:
String command = "libreoffice5.0 --invisible --convert-to pdf:writer_pdf_Export --outdir " + destFilepath + " " + source; try { p = Runtime.getRuntime().exec(command); p.waitFor(); } catch (InterruptedException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }