Reputation: 45
cell12 = new Cell(1, 1)
.setBorderRight(Border.NO_BORDER)
.add(new Paragraph(" Amount"))
.setTextAlignment(TextAlignment.CENTER)
.setVerticalAlignment(VerticalAlignment.MIDDLE)
.setBackgroundColor(bg).setMarginRight(0)
.setFont(f)
.setFontSize(9).setBold().setFontColor(Color.BLACK);
if (chck_bx.isSelected()) {
float[] columnWidths = {3, 6, 24, 7, 7, 7, 12, 7, 12};
table = new Table(columnWidths);
table.setWidthPercent(100);
Image itext = new Image(ImageDataFactory.create(getClass()
.getResource("/images/" + "abc.png")))
.setWidth(5).setHeight(7);
float[] columnWidths_small = {5, 8};
Table table_small = new Table(columnWidths_small);
table_small.setWidthPercent(100);
Cell cell11_1 = new Cell(1, 2)
.add(new Paragraph("col1"))
.setTextAlignment(TextAlignment.CENTER)
.setVerticalAlignment(VerticalAlignment.MIDDLE)
.setBackgroundColor(bg)
.setFont(f)
.setFontSize(9).setBold().setFontColor(Color.BLACK);
Cell cell11_1_1 = new Cell(1, 1)
.add(new Paragraph("subcol1"))
.setTextAlignment(TextAlignment.CENTER)
.setVerticalAlignment(VerticalAlignment.MIDDLE)
.setBackgroundColor(bg)
.setFont(f)
.setFontSize(9).setBold().setFontColor(Color.BLACK);
Cell cell11_1_2 = new Cell(1, 1)
.add(new Paragraph("subcol2"))
.setTextAlignment(TextAlignment.CENTER)
.setVerticalAlignment(VerticalAlignment.MIDDLE)
.setBackgroundColor(bg)
.setFont(f)
.setFontSize(9).setBold().setFontColor(Color.BLACK);
Cell cell11_1_0 = new Cell(1, 2)
.add(table_small)
.setTextAlignment(TextAlignment.CENTER)
.setVerticalAlignment(VerticalAlignment.MIDDLE)
.setBackgroundColor(bg)
.setFont(f)
.setFontSize(9).setBold().setFontColor(Color.BLACK).setPadding(0).setBorder(Border.NO_BORDER);
table_small.setBorder(Border.NO_BORDER).addCell(cell11_1).addCell(cell11_1_1).addCell(cell11_1_2);
table.addHeaderCell(cell1)
.addHeaderCell(cell5)
.addHeaderCell(cell4)
.addHeaderCell(cell6)
.addHeaderCell(cell7)
.addHeaderCell(cell9)
.addHeaderCell(cell12)
.addHeaderCell(cell11_1_0);
The above cells 1,5,, 4, 6, 7, 9, 12 are normal cells while cell11_1_0 is special cell. When I run the code in windows7 the bottom borders of all the normal cells are missing and I only see the bottom border of cell11_1_0. The other borders are intact. The same java code works in Ubuntu and Windows 10
Upvotes: 0
Views: 574
Reputation: 45
Strangely, the bottom border is not visible in win7 32 bit version generated pdf file, but when it is printed(on paper) I saw the border. Thank you.
Upvotes: 0