|
@@ -136,9 +136,11 @@ public class PdfAddimgUtil {
|
|
|
// 添加图片
|
|
|
|
|
|
// 设置图片的新宽度和高度
|
|
|
- float newWidth = 75f; // 新的宽度
|
|
|
- float newHeight = image.getScaledHeight() * (newWidth / image.getScaledWidth()); // 根据宽度计算高度
|
|
|
- image.scaleAbsolute(newWidth, newHeight); // 设置图片的新尺寸
|
|
|
+ if (!type.equals("6")) {
|
|
|
+ float newWidth = 75f; // 新的宽度
|
|
|
+ float newHeight = image.getScaledHeight() * (newWidth / image.getScaledWidth()); // 根据宽度计算高度
|
|
|
+ image.scaleAbsolute(newWidth, newHeight); // 设置图片的新尺寸
|
|
|
+ }
|
|
|
//调整图片尺寸
|
|
|
image.setAbsolutePosition(x, y);
|
|
|
under.addImage(image);
|
|
@@ -216,9 +218,11 @@ public class PdfAddimgUtil {
|
|
|
// 添加图片
|
|
|
|
|
|
// 设置图片的新宽度和高度
|
|
|
- int newWidth = cmToPx(wide);
|
|
|
- int newHeight = cmToPx(hign);
|
|
|
- image.scaleAbsolute(newWidth, newHeight); // 设置图片的新尺寸
|
|
|
+ if (!type.equals("6")) {
|
|
|
+ int newWidth = cmToPx(wide);
|
|
|
+ int newHeight = cmToPx(hign);
|
|
|
+ image.scaleAbsolute(newWidth, newHeight); // 设置图片的新尺寸
|
|
|
+ }
|
|
|
//调整图片尺寸
|
|
|
// image.scaleAbsolute(newWidth, newHeight);
|
|
|
image.setAbsolutePosition(x, y);
|