Ver código fonte

图片显示问题

tags/v1.1.0
qiujinyang 2 anos atrás
pai
commit
0ffe69ddde
1 arquivos alterados com 9 adições e 4 exclusões
  1. +9
    -4
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ReportServiceImpl.java

+ 9
- 4
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ReportServiceImpl.java Ver arquivo

@@ -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);

Carregando…
Cancelar
Salvar