1.第一步,引入bc包的安装依赖。
在pom.xml中引入。
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.60</version>
</dependency>
引入后reimport一下项目。
2.pdf文件转换成Base64.
/**
* @Description:
* @param:
* @return:
* @author: TateBrown
* @Date: 2018/7/25
*/
@ApiOperation("根据docid返回pdf文件Base64编码")
@PostMapping("/FindPDFBase")
public R FindPDFBase(@PathVariable("signdocid") Integer signdocid){
FileInputStream fin=null;
BufferedInputStream bin=null;
ByteArrayOutputStream baos=null;
BufferedOutputStream bout=null;
try{
SignDocEntity signDoc = signDocService.selectById(signdocid);
String filepath=signDoc.getUrl();

最低0.47元/天 解锁文章
9888

被折叠的 条评论
为什么被折叠?



