PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

How can I prevent table cell content from overflowing?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2257
Page 1 of 1

Author:  crypto_rsa [ Thu Dec 06, 2012 12:56 pm ]
Post subject:  How can I prevent table cell content from overflowing?

I have a table (defined using MigraDoc) in which I set the column widths manually. I put in some content (which might be wider than the column). If I export the document to RTF, it looks OK. However, in PDF the part of the content which does not fit in the column overflows on the next line, so that it is drawn over whatever is under it. Is there a way to prevent this behaviour?

Author:  Thomas Hoevel [ Thu Dec 06, 2012 1:08 pm ]
Post subject:  Re: How can I prevent table cell content from overflowing?

Hi!
crypto_rsa wrote:
However, in PDF the part of the content which does not fit in the column overflows on the next line, so that it is drawn over whatever is under it.
Row height is normally determined automatically, so if content breaks into the next line, the table grows with the contents.

In PDF, text will only break at spaces or hyphens. If a single "word" is wider than the column, it will be drawn over the next column. Insert soft hyphens in long "words" to allow MigraDoc to break them.

See also:
viewtopic.php?p=6177#p6177

Author:  crypto_rsa [ Thu Dec 06, 2012 1:16 pm ]
Post subject:  Re: How can I prevent table cell content from overflowing?

Is there a way to "clip" the content to the column (so that the overflowing part will not be visible) instead of breaking it to the next line?

Author:  Thomas Hoevel [ Thu Dec 06, 2012 1:27 pm ]
Post subject:  Re: How can I prevent table cell content from overflowing?

Here is code that does it:
viewtopic.php?p=6156#p6156

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/