@Test public void imageCellShouldHaveCenterAlignment() throws Exception { PdfPCell cell = imageCell(); assertThat(cell.getHorizontalAlignment(), is(Element.ALIGN_CENTER)); assertThat(cell.getVerticalAlignment(), is(Element.ALIGN_MIDDLE)); }
public static PdfPCell imageCell() throws BadElementException, IOException { Resource resource = new ClassPathResource(OK_IMAGE); Image image = Image.getInstance(resource.getFile().getAbsolutePath()); PdfPCell cell = new PdfPCell(image); cell.setPadding(CELL_PADDING); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); cell.setHorizontalAlignment(Element.ALIGN_CENTER); return cell; }
RequisitionCellFactory { public static PdfPCell imageCell() throws BadElementException, IOException { Resource resource = new ClassPathResource(OK_IMAGE); Image image = Image.getInstance(resource.getFile().getAbsolutePath()); PdfPCell cell = new PdfPCell(image); cell.setPadding(CELL_PADDING); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); cell.setHorizontalAlignment(Element.ALIGN_CENTER); return cell; } }
RequisitionCellFactory { public static PdfPCell imageCell() throws BadElementException, IOException { Resource resource = new ClassPathResource(OK_IMAGE); Image image = Image.getInstance(resource.getFile().getAbsolutePath()); PdfPCell cell = new PdfPCell(image); cell.setPadding(CELL_PADDING); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); cell.setHorizontalAlignment(Element.ALIGN_CENTER); return cell; }  }
RequisitionCellFactory { public static PdfPCell imageCell() throws BadElementException, IOException { Resource resource = new ClassPathResource(OK_IMAGE); Image image = Image.getInstance(resource.getFile().getAbsolutePath()); PdfPCell cell = new PdfPCell(image); cell.setPadding(CELL_PADDING); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); cell.setHorizontalAlignment(Element.ALIGN_CENTER); return cell; }  static PdfPCell numberCell(String value); static PdfPCell textCell(String value); static PdfPCell headingCell(String value); static List<PdfPCell> getCells(List<? extends Column> visibleColumns,
                                        LineItem lineItem,
                                        String currency); static PdfPCell imageCell(); static PdfPCell categoryRow(Integer visibleColumnsSize, LineItem lineItem); }
RequisitionCellFactory { public static PdfPCell imageCell() throws BadElementException, IOException { Resource resource = new ClassPathResource(OK_IMAGE); Image image = Image.getInstance(resource.getFile().getAbsolutePath()); PdfPCell cell = new PdfPCell(image); cell.setPadding(CELL_PADDING); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); cell.setHorizontalAlignment(Element.ALIGN_CENTER); return cell; }  static PdfPCell numberCell(String value); static PdfPCell textCell(String value); static PdfPCell headingCell(String value); static List<PdfPCell> getCells(List<? extends Column> visibleColumns,
                                        LineItem lineItem,
                                        String currency); static PdfPCell imageCell(); static PdfPCell categoryRow(Integer visibleColumnsSize, LineItem lineItem); static final float CELL_PADDING; static final BaseColor HEADER_BACKGROUND; static final Font H2_FONT; static final int WIDTH_PERCENTAGE; static final Logger logger; }