|
|
@@ -470,16 +470,21 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp |
|
|
|
cell.add(new Paragraph(str, font)); |
|
|
|
} else{ |
|
|
|
//String url = CommonConfig.imageURL + reportInfoVO.getQuestionReportList().get(i).getFileMarkerUrl(); |
|
|
|
Image image = null; |
|
|
|
String url = reportInfoVO.getQuestionReportList().get(i).getFileMarkerUrl(); |
|
|
|
UrlResource urlResource = new UrlResource(url); |
|
|
|
if (urlResource.exists()) { |
|
|
|
Image image = Image.getInstance(url); |
|
|
|
if (new UrlResource(url).exists()) { |
|
|
|
image = Image.getInstance(url); |
|
|
|
image.setAlignment(Image.ALIGN_CENTER); |
|
|
|
image.scalePercent(100); //依照比例缩放 |
|
|
|
image.setAbsolutePosition(0, 0); |
|
|
|
image.scaleToFit(300, 300);//自定义大 |
|
|
|
} else { |
|
|
|
log.error("图片不存在!" + url); |
|
|
|
} |
|
|
|
if (new UrlResource(url).exists()) { |
|
|
|
cell.add(image); |
|
|
|
} else { |
|
|
|
cell.add(new Paragraph("")); |
|
|
|
log.error("图片不存在!" + url); |
|
|
|
} |
|
|
|
} |
|
|
|
table4.addCell(cell); |