|
|
|
@ -842,6 +842,7 @@ public class CollectController extends Controller {
|
|
|
|
|
OutputStream out = response.getOutputStream();
|
|
|
|
|
PDDocument document = PDDocument.load(FileUtil.readBytes(pdfPath)); //加载pdf
|
|
|
|
|
PDDocumentInformation info = document.getDocumentInformation(); //获得文档属性对象
|
|
|
|
|
//对比原来的代码,就是在文件流写入响应体之前,经过一下pdfbox,修改标题属性,然后pdfbox的save方法可以直接写入到响应体中。
|
|
|
|
|
info.setTitle(pdfName); //修改标题属性 这个标题会被展示
|
|
|
|
|
document.setDocumentInformation(info);
|
|
|
|
|
document.save(out); //修改完直接输出到响应体中
|
|
|
|
|