java word 转pdf(aspose)

我是研究僧i 提交于 2019-12-01 12:26:39
/** * word  转pdf * * @param source 输入文件 源  doc ,docx * @param target 输入文件  目标 pdf */public static void wordToPdf(File source, File target) {    FileOutputStream os = null;    try {        os = new FileOutputStream(target);        // Address是将要被转化的word文档        com.aspose.words.Document doc = new com.aspose.words.Document(source.getPath());        doc.save(os, SaveFormat.PDF);    } catch (Exception e) {        e.printStackTrace();    } finally {        if (os != null) {            try {                os.close();            } catch (IOException e) {                e.printStackTrace();            }        }    }}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!