Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VariableBorder cell renders border differently from nonVariableBorder cell #1207

Open
StevenStreasick opened this issue Aug 15, 2024 · 0 comments
Labels

Comments

@StevenStreasick
Copy link

StevenStreasick commented Aug 15, 2024

Describe the bug

useVariableBorder(true) causes a cell to render its border slightly inward compared to a nonVariableBorder counterpart (See image below)

VariableBorders

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant