| | |
| | | zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE - 6); |
| | | zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE -4); |
| | | zongJianTitleFont.setStyle(Font.BOLD); |
| | | PdfPTable tableQz = new PdfPTable(new float[]{90f, 90f, 60f, 60f, 60f, 60f}); |
| | | PdfPTable tableQz = new PdfPTable(new float[]{80f, 80f, 60f, 40f,40f, 60f, 55f}); |
| | | tableQz.setTotalWidth(PageSize.A4.getWidth() - 100); |
| | | tableQz.setLockedWidth(true); |
| | | tableQz.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPadding(10); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | // cell.setPadding(10); |
| | | if (!file.exists()) { |
| | | cell.setPhrase(new Phrase("", zongJianFont)); |
| | | } else { |
| | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPadding(10); |
| | | // cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | // cell.setPadding(10); |
| | | |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | String zongjianysname = sysConfigService.selectConfigByKey("pdf_report_zongjianysname"); |
| | | if (zongJianYiShiQianMing == null && StrUtil.isNotBlank(zongjianysname) && !zongjianysname.equals("无")) { |
| | | cell.setPhrase(new Phrase(zongjianysname, zongJianFont)); |
| | |
| | | } else { |
| | | byte[] bytes = Base64.getDecoder().decode(zongJianYiShiQianMing.getTemplate()); |
| | | Image image = Image.getInstance(bytes); |
| | | image.scaleToFit(60, 60); |
| | | image.scaleToFit(20, 20); |
| | | // image.scaleAbsolute(20,20); |
| | | // cell.addElement(image); |
| | | |
| | | cell.setPaddingLeft(-10); |
| | | // cell.setPaddingTop(5); |
| | | // cell.setPaddingBottom(15); |
| | | String pdfSfsgqz = sysConfigService.selectConfigByKey("pdf_sfsgqz"); |
| | |
| | | } |
| | | cell.setImage(image); |
| | | } |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(new Phrase("", zongJianTitleFont)); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPadding(0); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(new Phrase("总检日期:", zongJianTitleFont)); |
| | |
| | | cell = new PdfPCell(new Phrase(new SimpleDateFormat("yyyy-MM-dd").format(tjOrder.getCheckTime()), zongJianFont)); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPadding(10); |
| | | // cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | // cell.setPadding(10); |
| | | |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | tableQz.addCell(cell); |
| | | document2.add(tableQz); |
| | | } else { |