Skip to content

How to fix Leading causing vertical alignment to be ignored #1175

Discussion options

You must be logged in to vote

I finally found the time to investigate this issue more thoroughly. While at first, it may appear that leading causes vertical alignment to be ignored, this could be less from true. With this example, where the vertical alignment is set to ALIGN_BOTTOM, we can see that the vertical alignment is respected.

cell.setMinimumHeight(10f);
cell.setVerticalAlignment(PdfPCell.ALIGN_BOTTOM);
cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT);
cell.setLeading(1, 2);
randomTable.addCell(cell);
doc.add(randomTable);

If we look at the example below, we can start to get a better picture of what's going on.

PdfPCell bigCell = new PdfPCell(new Phrase("Hello World!"));
bigCell.setMinimumHeight(200f);
bigCe…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by StevenStreasick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant