使用jacob 插件
链接: https://pan.baidu.com/s/1un6Hb2P4y3OhI3iHOgldrg 密码: j5v8
这是jacob 插件下载地方 有需要的可以自行下载
使用:
首先 将文件中
jacob-1.19-x86.dll 、jacob-1.19-x64.dll 文件放到jdk bin目录下,用户调用时启动插件功能
Java代码中如下:
package com.csnt.hbzpt.Helpper;
import com.csnt.hbzpt.action.ComplaintHistory.ComplainFlowInfoSaveAction;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
import com.smartdp.components.tracer.TracerFactory;
import com.smartdp.components.tracer.interfaces.Tracer;
import java.io.File;
//import org.xhtmlrenderer.pdf.ITextRenderer;/
/**
* Created by Administrator on 2018/9/12.
* word文档转换pdf
*/
public class PdfGenerateHelper {
static final int wdFormatPDF = 17