PdfPTable tbl = new PdfPTable(2); PdfPCell cell = new PdfPCell(new Phrase("1.")); cell.setHorizontalAlignment(Element.ALIGN_RIGHT); cell.disableBorderSide(Rectangle.BOX); tbl.addCell(cell); cell = new PdfPCell(new Phrase("some random text")); cell.disableBorderSide(Rectangle.BOX); tbl.addCell(cell); cell = new PdfPCell(new Phrase("34.")); cell.disableBorderSide(Rectangle.BOX); cell.setHorizontalAlignment(Element.ALIGN_RIGHT); tbl.addCell(cell); cell = new PdfPCell(new Phrase("some more random text")); cell.disableBorderSide(Rectangle.BOX); tbl.addCell(cell);
public MasterPageHeaderFooter() { super( 1 ); super.setTotalWidth( 1000 ); super.setWidthPercentage( 100f ); tableCell = new ExtendedPdfPCell(); tableCell.disableBorderSide( Rectangle.BOX ); }
private PdfPTable createTable() { int[] headerWidths = Ints.toArray(getHeaderWidths()); Map<String, HeaderAlignment> headerValues = getHeaderValues(locale); PdfPTable warehouseTable = pdfHelper.createTableWithHeader(headerWidths.length, Lists.newArrayList(headerValues.keySet()), false, headerWidths, headerValues); warehouseTable.getDefaultCell().disableBorderSide(PdfPCell.RIGHT); warehouseTable.getDefaultCell().disableBorderSide(PdfPCell.LEFT); warehouseTable.setHeaderRows(1); warehouseTable.setSpacingAfter(12.0f); return warehouseTable; }
public MasterPageHeaderFooter() { super( 1 ); super.setTotalWidth( 1000 ); super.setWidthPercentage( 100f ); tableCell = new ExtendedPdfPCell(); tableCell.disableBorderSide( Rectangle.BOX ); }
private void addTableToDocument(Document document, Entity orderEntity, Locale locale, String headerKey, Map<String, String> values) throws DocumentException { document.add(new Paragraph(translationService.translate(headerKey, locale), FontUtils.getDejavuBold10Dark())); Map<String, HeaderAlignment> headerValues = Maps.newLinkedHashMap(); for (String key : values.keySet()) { headerValues.put(translationService.translate(String.format(L_TRANSLATION_PATH, key), locale), HeaderAlignment.LEFT); } PdfPTable table = pdfHelper.createTableWithHeader(values.size(), Lists.newArrayList(headerValues.keySet()), false, headerValues); table.getDefaultCell().disableBorderSide(PdfPCell.RIGHT); table.getDefaultCell().disableBorderSide(PdfPCell.LEFT); table.setHeaderRows(1); for (String value : values.values()) { table.addCell(createCell(value, Element.ALIGN_LEFT)); } table.setSpacingAfter(20); document.add(table); }
private PdfPCell createCell(String content, int alignment) { PdfPCell cell = new PdfPCell(); float border = 0.2f; cell.setPhrase(new Phrase(content, FontUtils.getDejavuRegular7Dark())); cell.setHorizontalAlignment(alignment); cell.setBorderWidth(border); cell.disableBorderSide(PdfPCell.RIGHT); cell.disableBorderSide(PdfPCell.LEFT); cell.setPadding(5); return cell; } }
private PdfPCell createCell(String content, int alignment) { PdfPCell cell = new PdfPCell(); float border = 0.2f; cell.setPhrase(new Phrase(content, FontUtils.getDejavuRegular7Dark())); cell.setHorizontalAlignment(alignment); cell.setBorderWidth(border); cell.disableBorderSide(PdfPCell.RIGHT); cell.disableBorderSide(PdfPCell.LEFT); cell.setPadding(5); return cell; }
private PdfPCell createCell(String content, int alignment) { PdfPCell cell = new PdfPCell(); cell.setFixedHeight(30f); float border = 0.2f; cell.setPhrase(new Phrase(content, FontUtils.getDejavuRegular9Dark())); cell.setHorizontalAlignment(alignment); cell.setBorderWidth(border); cell.disableBorderSide(PdfPCell.RIGHT); cell.disableBorderSide(PdfPCell.LEFT); cell.setPadding(5); return cell; }
cell.disableBorderSide(PdfPCell.TOP); cell.disableBorderSide(PdfPCell.BOTTOM); cell.disableBorderSide(PdfPCell.RIGHT); cell.disableBorderSide(PdfPCell.LEFT); } else { cell.enableBorderSide(PdfPCell.TOP); cell.disableBorderSide(PdfPCell.BOTTOM); } else { cell.enableBorderSide(PdfPCell.BOTTOM); cell.disableBorderSide(PdfPCell.LEFT); } else { cell.enableBorderSide(PdfPCell.LEFT); cell.disableBorderSide(PdfPCell.RIGHT); } else { cell.enableBorderSide(PdfPCell.RIGHT); cell.disableBorderSide(PdfPCell.TOP); } else { cell.enableBorderSide(PdfPCell.TOP);
total.setVerticalAlignment(Element.ALIGN_MIDDLE); total.setBackgroundColor(null); total.disableBorderSide(Rectangle.RIGHT); total.disableBorderSide(Rectangle.LEFT); total.setBorderColor(ColorUtils.getLineLightColor());
PdfPTable positionsTable = pdfHelper.createTableWithHeader(numOfColumns, Lists.newArrayList(headerValues.keySet()), false, headerWidths, headerValues); positionsTable.getDefaultCell().disableBorderSide(PdfPCell.RIGHT); positionsTable.getDefaultCell().disableBorderSide(PdfPCell.LEFT); positionsTable.setHeaderRows(1); List<Entity> positions = PositionDataProvider.getPositions(documentEntity);
total.setVerticalAlignment(Element.ALIGN_MIDDLE); total.setBackgroundColor(null); total.disableBorderSide(Rectangle.RIGHT); total.disableBorderSide(Rectangle.LEFT); total.setBorderColor(ColorUtils.getLineLightColor());
cell.disableBorderSide( PdfPCell.TOP ); cell.disableBorderSide( PdfPCell.BOTTOM ); cell.disableBorderSide( PdfPCell.RIGHT ); cell.disableBorderSide( PdfPCell.LEFT ); cell.disableBorderSide( PdfPCell.BOTTOM ); cell.disableBorderSide( PdfPCell.LEFT ); cell.disableBorderSide( PdfPCell.RIGHT ); cell.disableBorderSide( PdfPCell.TOP );
cell.disableBorderSide( PdfPCell.TOP ); cell.disableBorderSide( PdfPCell.BOTTOM ); cell.disableBorderSide( PdfPCell.RIGHT ); cell.disableBorderSide( PdfPCell.LEFT ); cell.disableBorderSide( PdfPCell.BOTTOM ); cell.disableBorderSide( PdfPCell.LEFT ); cell.disableBorderSide( PdfPCell.RIGHT ); cell.disableBorderSide( PdfPCell.TOP );
total.setVerticalAlignment(Element.ALIGN_MIDDLE); total.setBackgroundColor(null); total.disableBorderSide(Rectangle.RIGHT); total.disableBorderSide(Rectangle.LEFT); total.setBorderColor(ColorUtils.getLineLightColor());
cell.disableBorderSide( PdfPCell.TOP ); cell.disableBorderSide( PdfPCell.BOTTOM ); cell.disableBorderSide( PdfPCell.RIGHT ); cell.disableBorderSide( PdfPCell.LEFT ); cell.disableBorderSide( PdfPCell.BOTTOM ); cell.disableBorderSide( PdfPCell.LEFT ); cell.disableBorderSide( PdfPCell.RIGHT ); cell.disableBorderSide( PdfPCell.TOP );
currentStorageLocation = storageLocation; if (counter == 1) { dataTable.getDefaultCell().disableBorderSide(PdfPCell.BOTTOM); dataTable.getDefaultCell().disableBorderSide(PdfPCell.TOP); dataTable.getDefaultCell().disableBorderSide(PdfPCell.BOTTOM); dataTable.getDefaultCell().enableBorderSide(Rectangle.RIGHT); dataTable.addCell(new Phrase("", FontUtils.getDejavuRegular10Dark())); dataTable.getDefaultCell().disableBorderSide(Rectangle.LEFT); dataTable.getDefaultCell().disableBorderSide(Rectangle.RIGHT); counter++;
currentStorageLocation = storageLocation; if(counter == 1) { dataTable.getDefaultCell().disableBorderSide(PdfPCell.BOTTOM); dataTable.getDefaultCell().disableBorderSide(PdfPCell.TOP); dataTable.getDefaultCell().disableBorderSide(PdfPCell.BOTTOM);
pdfPCell.disableBorderSide( borderSide );
positionsTable.getDefaultCell().disableBorderSide(PdfPCell.RIGHT); positionsTable.getDefaultCell().disableBorderSide(PdfPCell.LEFT); positionsTable.setHeaderRows(1); List<Entity> positions = PositionDataProvider.getPositions(documentEntity);