OpenPDF
OpenPDF copied to clipboard
VariableBorder cell renders border differently from nonVariableBorder cell
Describe the bug
useVariableBorder(true) causes a cell to render its border slightly inward compared to a nonVariableBorder counterpart (See image below)
To Reproduce
This code was used to generate the image above
PdfPTable table = new PdfPTable(2);
table.setWidthPercentage(100f);
PdfPCell cell = new PdfPCell(new Phrase("Variable Borders"));
cell.setBorderWidth(5);
cell.setUseVariableBorders(true);
cell.setUseBorderPadding(true); //This is to prevent the text from getting squashed by the border - The issue is replicable without this line
PdfPCell normalCell = new PdfPCell(new Phrase("Non Variable Borders"));
normalCell.setBorderWidth(5);
normalCell.setUseBorderPadding(true);
normalCell.setUseBorderPadding(true);
table.addCell(cell);
table.addCell(normalCell);
doc.add(table);
Expected behavior
I would expect both of these cell borders to be identical, as the only thing differing from these cells, aside from the text, is the isVariableBorders boolean
System
- OS: Windows
- Used font: Default font
- OpenPDF version: 2.0.3
Your real name
Steven Streasick