use of com.itextpdf.text.Image in project bamboobsc by billchen198318.
the class PersonalReportPdfCommand method putSignature.
private void putSignature(PdfPTable table, Context context) throws Exception {
String uploadOid = (String) context.get("uploadSignatureOid");
if (StringUtils.isBlank(uploadOid)) {
return;
}
byte[] imageBytes = UploadSupportUtils.getDataBytes(uploadOid);
if (null == imageBytes) {
return;
}
Image signatureImgObj = Image.getInstance(imageBytes);
signatureImgObj.setWidthPercentage(40f);
PdfPCell cell = new PdfPCell();
cell.setBorder(Rectangle.NO_BORDER);
cell.addElement(signatureImgObj);
table.addCell(cell);
}
Aggregations