use of com.itextpdf.layout.element.Cell in project betca-tpv-spring by miw-upm.
the class PdfTicketBuilder method tableColspanRight.
public PdfTicketBuilder tableColspanRight(String value) {
Cell cell = new Cell(1, this.getTable().getNumberOfColumns());
cell.setTextAlignment(TextAlignment.RIGHT).setBold().setFontSize(TERMIC_FONT_SIZE_EMPHASIZEDD);
cell.add(value);
this.getTable().addCell(cell);
this.getDocument().add(this.getTable());
return this;
}
use of com.itextpdf.layout.element.Cell in project betca-tpv-spring by miw-upm.
the class PdfTag24Builder method build.
public Optional<byte[]> build() {
while (tag24 % 3 != 0) {
Cell cell = new Cell();
cell.setBorder(Border.NO_BORDER);
this.getTable().addCell(cell);
this.getDocument().add(this.getTable());
tag24++;
}
this.getDocument().close();
try {
return Optional.of(Files.readAllBytes(new File(this.getFullPath()).toPath()));
} catch (IOException ioe) {
Logger.getLogger(this.getClass()).error("IO: " + ioe);
}
return Optional.empty();
}
use of com.itextpdf.layout.element.Cell in project ComponentManagement by Bac3Phi.
the class InventoriesReportController method addTableInventories.
private void addTableInventories(Document document) throws SQLException {
float[] pointColumnWidths = { 200F, 200F, 200F, 200F, 200F };
Table table = new Table(pointColumnWidths);
table.addCell(new Cell().add("Mã Chi Tiết Hàng Tồn").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
table.addCell(new Cell().add("Tên Mặt Hàng").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
table.addCell(new Cell().add("Lượng Nhập").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
table.addCell(new Cell().add("Lượng Bán").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
table.addCell(new Cell().add("Lượng Tồn").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
resultSet = dbConn.getData("SELECT CTBCHT.MaCTBC, MH.TenMH, SUM(CTPN.SoLuong) AS LuongNhapBĐ, SUM(CTHD.SoLuong) AS LuongBan, SUM(MH.SoLuong) AS LuongTon FROM CHITIETBAOCAOHANGTON CTBCHT JOIN MATHANG MH JOIN CHITIETPHIEUNHAP CTPN JOIN CHITIETHOADON CTHD ON CTBCHT.MaMH = MH.MaMH AND CTPN.MaMH = CTBCHT.MaMH AND CTHD.MaMH = CTBCHT.MaMH WHERE MaBCHT = '" + txtReportID.getText() + "'" + "GROUP BY TenMH;");
while (resultSet.next()) {
table.addCell(new Cell().add(resultSet.getString("MaCTBC")).setTextAlignment(TextAlignment.LEFT).setFontSize(12));
table.addCell(new Cell().add(resultSet.getString("TenMH")).setTextAlignment(TextAlignment.LEFT).setFontSize(12));
table.addCell(new Cell().add(String.valueOf(resultSet.getLong("LuongNhapBĐ"))).setTextAlignment(TextAlignment.RIGHT).setFontSize(12));
table.addCell(new Cell().add(String.valueOf(resultSet.getLong("LuongBan"))).setTextAlignment(TextAlignment.RIGHT).setFontSize(12));
table.addCell(new Cell().add(String.valueOf(resultSet.getLong("LuongTon"))).setTextAlignment(TextAlignment.RIGHT).setFontSize(12));
}
document.add(table);
}
use of com.itextpdf.layout.element.Cell in project MtgDesktopCompanion by nicho92.
the class PDFExport method createCell.
private Cell createCell(MagicCard card) throws IOException {
ImageData imageData = null;
try {
imageData = ImageDataFactory.create(getEnabledPlugin(MTGPictureProvider.class).getFullSizePicture(card), null);
} catch (Exception e) {
imageData = ImageDataFactory.create(getEnabledPlugin(MTGPictureProvider.class).getBackPicture(), null);
}
var image = new Image(imageData);
image.scaleAbsolute(2.49f * userPoint, 3.48f * userPoint);
var cell = new Cell();
if (getBoolean("PRINT_CUT_LINE")) {
cell.setBorder(new DottedBorder(0.5f));
} else
cell.setBorder(Border.NO_BORDER);
if (getInt(SPACE) != null)
cell.setPadding(getInt(SPACE));
cell.add(image);
return cell;
}
use of com.itextpdf.layout.element.Cell in project betca-tpv-spring by miw-upm.
the class PdfTag24Builder method addTag24.
public PdfTag24Builder addTag24(String description, String code) {
assert description != null;
assert code != null;
if ((tag24 % 24) == 0) {
if (tag24 > 0) {
this.getDocument().add(new AreaBreak(AreaBreakType.NEXT_PAGE));
}
this.prepareTags24();
}
Cell cell = new Cell();
cell.setPaddingTop(10);
cell.setMinHeight(84.2F);
cell.setBorder(Border.NO_BORDER);
cell.setTextAlignment(TextAlignment.CENTER);
cell.add(description);
if (!code.isEmpty()) {
BarcodeEAN barcode = new BarcodeEAN(this.getDocument().getPdfDocument());
barcode.setCodeType(BarcodeEAN.EAN13);
barcode.setCode(code.trim());
Image barcodeImage = new Image(barcode.createFormXObject(this.getDocument().getPdfDocument()));
barcodeImage.setWidthPercent(70);
barcodeImage.setHorizontalAlignment(HorizontalAlignment.CENTER);
cell.add(barcodeImage);
}
this.getTable().addCell(cell);
this.getDocument().add(this.getTable());
tag24++;
return this;
}
Aggregations