admin管理员组文章数量:1130349
kkFileView二开之word转pdf接口
- kkFileView二开系列文章:
- 1 kkFileView源码下载及编译
- 2 word转pdf接口
-
- 2.1 背景
- 2.2 接口开发
- 2.3 接口测试
-
- 2.3.1 word文件准备
- 2.3.2 文件链接转pdf
- 2.3.3 上传文件转pdf
- 3 部署
kkFileView二开系列文章:
- kkFileView二开之源码编译及部署
- kkFileView二开之内外网转换
- kkFileView二开之word转pdf接口
- kkFileView二开之Excel转pdf接口
- kkFileView二开之pdf转图片接口
- kkFileView二开之企业级安全问题处理
对应二开代码仓库:https://gitee/wbj_1/kk-file-view
1 kkFileView源码下载及编译
前文 【kkFileView二开之源码编译及部署】 已完成了kkFileView源码二开的基础准备。
2 word转pdf接口
2.1 背景
在实际工作过程中,经常会有系统针对word模板填充,并转换为pdf的需求,如合同、订单等文件,在代码内集成word转pdf一方面代码会比较臃肿,另一方面兼容性相较于kkfile会差一点。
在使用kkFileView的过程中,在线浏览word文档界面上可以以pdf的方式进行预览,因而想到可以使用kkFileView对外提供接口,传入指定的word文件后,将该文件转换为pdf后返回,通过阅读kkFileView源码后,发现可以实现,故编写该文档。
2.2 接口开发
在cn.keking.web.controller包下,新增ConvertController.java 文件
package cn.keking.web.controller;
import cn.keking.config.ConfigConstants;
import cn.keking.model.FileAttribute;
import cn.keking.model.FileType;
import cn.keking.model.ReturnResponse;
import cn.keking.service.FileHandlerService;
import cn.keking.service.OfficeToPdfService;
import cn.keking.utils.DownloadUtils;
import cn.keking.utils.KkFileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StreamUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import orgkkFileView二开之word转pdf接口
- kkFileView二开系列文章:
- 1 kkFileView源码下载及编译
- 2 word转pdf接口
-
- 2.1 背景
- 2.2 接口开发
- 2.3 接口测试
-
- 2.3.1 word文件准备
- 2.3.2 文件链接转pdf
- 2.3.3 上传文件转pdf
- 3 部署
kkFileView二开系列文章:
- kkFileView二开之源码编译及部署
- kkFileView二开之内外网转换
- kkFileView二开之word转pdf接口
- kkFileView二开之Excel转pdf接口
- kkFileView二开之pdf转图片接口
- kkFileView二开之企业级安全问题处理
对应二开代码仓库:https://gitee/wbj_1/kk-file-view
1 kkFileView源码下载及编译
前文 【kkFileView二开之源码编译及部署】 已完成了kkFileView源码二开的基础准备。
2 word转pdf接口
2.1 背景
在实际工作过程中,经常会有系统针对word模板填充,并转换为pdf的需求,如合同、订单等文件,在代码内集成word转pdf一方面代码会比较臃肿,另一方面兼容性相较于kkfile会差一点。
在使用kkFileView的过程中,在线浏览word文档界面上可以以pdf的方式进行预览,因而想到可以使用kkFileView对外提供接口,传入指定的word文件后,将该文件转换为pdf后返回,通过阅读kkFileView源码后,发现可以实现,故编写该文档。
2.2 接口开发
在cn.keking.web.controller包下,新增ConvertController.java 文件
package cn.keking.web.controller;
import cn.keking.config.ConfigConstants;
import cn.keking.model.FileAttribute;
import cn.keking.model.FileType;
import cn.keking.model.ReturnResponse;
import cn.keking.service.FileHandlerService;
import cn.keking.service.OfficeToPdfService;
import cn.keking.utils.DownloadUtils;
import cn.keking.utils.KkFileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StreamUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org本文标签: 接口kkFileViewWordpdf
版权声明:本文标题:kkFileView二开之word转pdf接口 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/jiaocheng/1763672273a2953234.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论