Search in sources :

Example 6 with Image

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);
}
Also used : PdfPCell(com.itextpdf.text.pdf.PdfPCell) Image(com.itextpdf.text.Image)

Aggregations

Image (com.itextpdf.text.Image)6 PdfPCell (com.itextpdf.text.pdf.PdfPCell)6 BufferedImage (java.awt.image.BufferedImage)4 Phrase (com.itextpdf.text.Phrase)2 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)2 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)2 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)2 DateRangeScoreVO (com.netsteadfast.greenstep.vo.DateRangeScoreVO)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 HashMap (java.util.HashMap)1