兴安pdf文件优化
This commit is contained in:
@@ -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,14 +619,17 @@ public class VisCarryStuffController extends BaseController {
|
|||||||
rightColumn.setWidthPercentage(100);
|
rightColumn.setWidthPercentage(100);
|
||||||
|
|
||||||
// 生成二维码图片
|
// 生成二维码图片
|
||||||
BarcodeQRCode qrCode = new BarcodeQRCode(code, 100, 100, null);
|
CheckCodeVo checkCodeVo = visCarryStuffService.selectStuffCheckCode(id);
|
||||||
Image qrCodeImage = qrCode.getImage();
|
if (ObjectUtil.isNotNull(checkCodeVo) && StrUtil.isNotBlank(checkCodeVo.getCode())) {
|
||||||
qrCodeImage.scaleAbsolute(100, 100);
|
BarcodeQRCode qrCode = new BarcodeQRCode(checkCodeVo.getCode(), 100, 100, null);
|
||||||
qrCodeImage.setAlignment(Element.ALIGN_CENTER);
|
Image qrCodeImage = qrCode.getImage();
|
||||||
|
qrCodeImage.scaleAbsolute(100, 100);
|
||||||
// 添加二维码到右边列
|
qrCodeImage.setAlignment(Element.ALIGN_CENTER);
|
||||||
rightColumn.addCell(createCell(qrCodeImage, Element.ALIGN_CENTER));
|
|
||||||
rightColumn.addCell(createCell(new Paragraph("出门证二维码", contentFont), Element.ALIGN_CENTER));
|
// 添加二维码到右边列
|
||||||
|
rightColumn.addCell(createCell(qrCodeImage, 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));
|
||||||
|
|||||||
Reference in New Issue
Block a user