Sfoglia il codice sorgente

图片显示问题

tags/v1.1.0
qiujinyang 2 anni fa
parent
commit
0ffe69ddde
1 ha cambiato i file con 9 aggiunte e 4 eliminazioni
  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 Vedi File

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

Loading…
Annulla
Salva