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 betca-tpv-core by miw-upm.
the class PdfTableBuilder method tableColspanRight.
public PdfTableBuilder tableColspanRight(String value) {
Cell cell = new Cell(1, this.table.getNumberOfColumns());
cell.setTextAlignment(TextAlignment.RIGHT).setBold().setFontSize(FONT_SIZE_EMPHASIZED);
cell.add(value);
this.table.addCell(cell);
return this;
}
use of com.itextpdf.layout.element.Cell in project i7js-highlevel by itext.
the class C05E12_JekyllHydeTableV5 method createPdf.
public void createPdf(String dest) throws IOException {
// Initialize PDF document
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
// Initialize document
Document document = new Document(pdf, PageSize.A4.rotate());
Table table = new Table(UnitValue.createPercentArray(new float[] { 3, 32 }));
table.setWidth(UnitValue.createPercentValue(100));
List<List<String>> resultSet = CsvTo2DList.convert(SRC, "|");
resultSet.remove(0);
table.addHeaderCell("imdb").addHeaderCell("Information about the movie");
Cell cell;
for (List<String> record : resultSet) {
table.addCell(record.get(0));
cell = new Cell().add(new Paragraph(record.get(1))).add(new Paragraph(record.get(2))).add(new Paragraph(record.get(3))).add(new Paragraph(record.get(4))).add(new Paragraph(record.get(5)));
cell.setKeepTogether(true);
table.addCell(cell);
}
document.add(table);
document.close();
}
use of com.itextpdf.layout.element.Cell in project i7js-highlevel by itext.
the class C05E14_JekyllHydeTableV7 method createPdf.
public void createPdf(String dest) throws IOException {
// Initialize PDF document
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
// Initialize document
Document document = new Document(pdf, PageSize.A4.rotate());
Table table = new Table(UnitValue.createPercentArray(new float[] { 3, 2, 14, 9, 4, 3 }));
table.setWidth(UnitValue.createPercentValue(100));
List<List<String>> resultSet = CsvTo2DList.convert(SRC, "|");
List<String> header = resultSet.remove(0);
for (String field : header) {
table.addHeaderCell(field);
}
for (List<String> record : resultSet) {
table.addCell(record.get(0));
table.addCell(record.get(1));
Cell cell = new Cell().add(new Paragraph(record.get(2)));
cell.setNextRenderer(new RunlengthRenderer(cell, record.get(5)));
table.addCell(cell);
table.addCell(record.get(3));
table.addCell(record.get(4));
table.addCell(record.get(5));
}
document.add(table);
document.close();
}
Aggregations