Hello,
I'm creating a PDF document using the FixedContentEditor class. In this document, I've to put a lot of tables and I use the Measure() function to read the height of the last table inserted in order to move the current position (with editor.Position.Translate) and to start with a new table.
Unfortunately, I noticed that this works fine but if the table has multi rows texts in cells, the Measure function gives me the result as the cells had only singles row texts in the cells.
To add a cell with multi rows text I use the following code:
TableRow row = table.Rows.AddTableRow();
TableCell cell = row.Cells.AddTableCell();
Block block = cell.Blocks.AddBlock();
block.InsertText(font, FontStyles.Normal, FontWeights.Bold,
"Details:"
);
cell = row.Cells.AddTableCell();
block = cell.Blocks.AddBlock();
foreach
(
string
line
in
multirows_text.Split(
'\n'
))
{
block.InsertText(fontFamily, fontStyle, fontWeight, line);
block.InsertLineBreak();
}
Then, I use the following code to get the table height:
table.Measure().Height
that gives me the same value both if the multirows_text string variable contains one or more lines of text
Is there another way to get the table height in case of tables with multiple lines of text cells?
Any help will be appreciated. Thanks in advance.
Giorgio