| | |
| | | |
| | | tableQz.addCell(cell); |
| | | |
| | | File file = new File(value + File.separator + "yinzhang.png"); |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase("", zongJianFont)); |
| | | if (!file.exists()) { |
| | | cell.setPhrase(new Phrase("", zongJianFont)); |
| | | }else { |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | byte[] fileBytes = new byte[(int) file.length()]; |
| | | fileInputStream.read(fileBytes); |
| | | fileInputStream.close(); |
| | | Image image = Image.getInstance(Base64.getDecoder().decode(Base64.getEncoder().encodeToString(fileBytes))); |
| | | image.scaleToFit(90, 90); |
| | | cell.addElement(image); |
| | | } |
| | | tableQz.addCell(cell); |
| | | |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |