diff --git a/com.actionsoft.apps.coe.pal.output.pr/lib/com.actionsoft.apps.coe.pal.output.pr.jar b/com.actionsoft.apps.coe.pal.output.pr/lib/com.actionsoft.apps.coe.pal.output.pr.jar index 948bf747..ed66d18b 100644 Binary files a/com.actionsoft.apps.coe.pal.output.pr/lib/com.actionsoft.apps.coe.pal.output.pr.jar and b/com.actionsoft.apps.coe.pal.output.pr/lib/com.actionsoft.apps.coe.pal.output.pr.jar differ diff --git a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/PrReportComment.java b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/PrReportComment.java index 3cb4eb2f..6844be99 100644 --- a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/PrReportComment.java +++ b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/PrReportComment.java @@ -328,7 +328,7 @@ public class PrReportComment { int width = sourceImg.getWidth(); int height = sourceImg.getHeight(); // 如果宽高比大于最大值的宽高比,说明图形较宽,需判断宽度是否大于最大值 - if (width / height > OutputWordUtil.PL_DIAGRAM_MAX_WIDTH / maxHeight) { + /*if (width / height > OutputWordUtil.PL_DIAGRAM_MAX_WIDTH / maxHeight) { if (width > OutputWordUtil.PL_DIAGRAM_MAX_WIDTH) { newWidth = OutputWordUtil.PL_DIAGRAM_MAX_WIDTH; newHeight = height * OutputWordUtil.PL_DIAGRAM_MAX_WIDTH / width; @@ -338,12 +338,27 @@ public class PrReportComment { } } else {// 如果宽高比小于最大值的宽高比,说明图形较高,需判断高度是否大于最大值 if (height > maxHeight) { - newWidth = width * maxHeight / height; + newWidth = width * maxHeight / height - 80; newHeight = maxHeight; } else { newWidth = width; newHeight = height; } + }*/ + //按照宽高超宽最大比例缩小width与height + if (width> OutputWordUtil.PL_DIAGRAM_MAX_WIDTH || height>maxHeight){ + double heightRate = (double) height / maxHeight; + double widthRate = (double) width / OutputWordUtil.PL_DIAGRAM_MAX_WIDTH; + if (widthRate>heightRate){ + newWidth = (int) (width/widthRate); + newHeight = (int) (height/widthRate); + }else { + newWidth = (int) (width/heightRate); + newHeight = (int) (height/heightRate); + } + }else { + newWidth = width; + newHeight = height; } } catch (FileNotFoundException e) { e.printStackTrace();