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

MigraDoc : how to achieve auto-pagebreak within a table row?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2116
Page 1 of 1

Author:  DJagonak [ Fri Aug 24, 2012 9:38 am ]
Post subject:  MigraDoc : how to achieve auto-pagebreak within a table row?

Hello,

I'm using MigraDoc in an ASP.NET app for dynamically creating PDF files and delivering them to the user/browser. In general everything works fine so far.
But as our textual content is being loaded from a database there happened to exist some very lengthy textblocks which won't fit onto one page. The layout consists of a dynamically created table with 2, 3 or 4 columns. My problem is that I wasn't able so far to find any options or switches to force MigraDoc do render a pagebreak at the proper position within these "oversized" textblock-rows. Instead it renders the table together with the text down through the footer to the very edge of the page. And on the next page it starts with the next row of the table, leaving the remainder of the row before being swallowed up somewhere.

Is there any chance to get this behavior changed without starting to manually calculate textlength, pagelength, space in layout, etc. ?

Regards,
Dietmar Jagonak

Author:  () => true [ Sun Aug 26, 2012 9:56 pm ]
Post subject:  Re: MigraDoc : how to achieve auto-pagebreak within a table

Hi!

There are no automatic pagebreaks within table rows (only automatic pagebreaks between table rows).

In our app, tables can have a comments column that can contain large amounts of text. We used a little trick: a "logical row" spans two physical table rows, the second row is reserved for the comments only (spanning the width of the page except for the first centimeter).
Maybe you can avoid your problem by changing the widths of columns, the size of the font, or using our trick. Or show the first 1000 characters only and add a link to an appendix with the complete text.

When a single table row needs more than a full page, a table is IMHO not the best way to display the text. Maybe a different format will look better (and avoid the MigraDoc limitation).

Author:  DJagonak [ Mon Aug 27, 2012 8:17 pm ]
Post subject:  Re: MigraDoc : how to achieve auto-pagebreak within a table

Hi,

thank you for this enlightening answer.
In fact this table based layout has not been my idea. But the customer originally wanted his PDF layout to be as similar as possible to the browser layout. Now that we discussed the matter and the problem he decided to completely change PDF layout so that there will be no need anymore for a multi column table.

Regards,
Dietmar Jagonak

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