PDFsharp & MigraDoc Foundation

Workaround for table row problem
Page 1 of 1

Author:  userDragos [ Tue Sep 06, 2022 11:49 am ]
Post subject:  Workaround for table row problem

I recently started a project using PDF sharp + Migra Doc and I encounter a problem which I have seen in other posts, there is no fixing automatically. Table row will be generated on the next page if it doesn't have enough space and if there is still not enough space it will just go into the border and the text is lost. I am thinking of a workaround but I am not sure exactly how it can be done.

My think is as follows:

If I am able to check how many lines of text can fit in cell with the given string I can create a variable and increase it every time I add text. with the excess of text I can simply create a new row (which will be automatically be added on the next page) and thus fixing my problem. Even if I am not counting lines, is there a way to check if the row becomes too large for the current page? If at a given time I can check if the cell is too large and will be automatically sent to the next page I can trim the string up to the point it will fit, save the remaining words that didn't fit and maximise the space within the page.

pdfsharp.PNG [ 30.08 KiB | Viewed 1507 times ]

Author:  TH-Soft [ Tue Sep 06, 2022 12:26 pm ]
Post subject:  Re: Workaround for table row problem

Also discussed here:

Author:  userDragos [ Tue Sep 06, 2022 12:53 pm ]
Post subject:  Re: Workaround for table row problem

That is my post and the response does not work, is it possible to retrieve the cell height or at least row height? row.Height.value brings back 0 as well as row.Height.centimetres before rendering. Thank you

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group