兴安pdf文件优化

This commit is contained in:
zc
2025-07-24 15:18:51 +08:00
parent 2d187af60d
commit 62f1980713

View File

@@ -567,10 +567,6 @@ public class VisCarryStuffController extends BaseController {
}); });
} }
//查询申请二维码
CheckCodeVo checkCodeVo = visCarryStuffService.selectStuffCheckCode(id);
String code = checkCodeVo.getCode();
// 创建PDF文档 // 创建PDF文档
Document document = new Document(new RectangleReadOnly(842F, 595F)); Document document = new Document(new RectangleReadOnly(842F, 595F));
document.setMargins(60, 60, 72, 72); document.setMargins(60, 60, 72, 72);
@@ -623,7 +619,9 @@ public class VisCarryStuffController extends BaseController {
rightColumn.setWidthPercentage(100); rightColumn.setWidthPercentage(100);
// 生成二维码图片 // 生成二维码图片
BarcodeQRCode qrCode = new BarcodeQRCode(code, 100, 100, null); CheckCodeVo checkCodeVo = visCarryStuffService.selectStuffCheckCode(id);
if (ObjectUtil.isNotNull(checkCodeVo) && StrUtil.isNotBlank(checkCodeVo.getCode())) {
BarcodeQRCode qrCode = new BarcodeQRCode(checkCodeVo.getCode(), 100, 100, null);
Image qrCodeImage = qrCode.getImage(); Image qrCodeImage = qrCode.getImage();
qrCodeImage.scaleAbsolute(100, 100); qrCodeImage.scaleAbsolute(100, 100);
qrCodeImage.setAlignment(Element.ALIGN_CENTER); qrCodeImage.setAlignment(Element.ALIGN_CENTER);
@@ -631,6 +629,7 @@ public class VisCarryStuffController extends BaseController {
// 添加二维码到右边列 // 添加二维码到右边列
rightColumn.addCell(createCell(qrCodeImage, Element.ALIGN_CENTER)); rightColumn.addCell(createCell(qrCodeImage, Element.ALIGN_CENTER));
rightColumn.addCell(createCell(new Paragraph("出门证二维码", contentFont), Element.ALIGN_CENTER)); rightColumn.addCell(createCell(new Paragraph("出门证二维码", contentFont), Element.ALIGN_CENTER));
}
// 将左右列添加到主表格 // 将左右列添加到主表格
mainTable.addCell(createCell(leftColumn, Element.ALIGN_LEFT)); mainTable.addCell(createCell(leftColumn, Element.ALIGN_LEFT));