修改导出pdf优化

master
hcy 2 years ago
parent 7dd88fc5c0
commit b92925cce5

@ -261,7 +261,8 @@ public class BatchExportServiceImpl implements BatchExportService {
while ((len = bis.read(buf, 0, buf.length)) != -1) { while ((len = bis.read(buf, 0, buf.length)) != -1) {
bos.write(buf, 0, len); bos.write(buf, 0, len);
} }
bis.close(); // 及时关闭流,避免资源泄露 //bis.close(); // 及时关闭流,避免资源泄露
out.reset(); // 重置ByteArrayOutputStream以便下次使用
} else { } else {
exportTaskDetailsMapper.upStatc(2, list.getId()); exportTaskDetailsMapper.upStatc(2, list.getId());
logger.log("病案号为:" + list.getInpNo() + "出院时间为:" + list.getDischargeDateTime() + "的病历保存失败。"); logger.log("病案号为:" + list.getInpNo() + "出院时间为:" + list.getDischargeDateTime() + "的病历保存失败。");
@ -352,7 +353,7 @@ public class BatchExportServiceImpl implements BatchExportService {
} }
document.add(image); document.add(image);
if (outFlag) { if (outFlag) {
System.out.println(); //System.out.println();
//目录跳转页面内容设置。 //目录跳转页面内容设置。
PdfAction action = PdfAction.gotoLocalPage(i + 1, new PdfDestination(PdfDestination.FIT), writer); PdfAction action = PdfAction.gotoLocalPage(i + 1, new PdfDestination(PdfDestination.FIT), writer);
//标题目录 //标题目录

Loading…
Cancel
Save