Search code examples
c#page-breakgembox-document

GemBox - Tables are cut on PDF


I've done a lot of searching about Gembox issues with tables, most of the problems seem like their requirement is to fit an entire table in a single page.

I do have the opposite problem as I would like to do a page break for every row that goes over the page. This works fine on .docx files and the rest of the table goes to the next page, but when it's rendered to PDF, this happens

enter image description here

I've also noticed a somewhat similar issue here but I can't figure out how I could apply

TableRowFormat().AllowBreakAcrossPage == true

for all the table rows in my scenario where I'm loading an existing .docx file via

var document = DocumentModel.Load(doc);

and converting it into PDF.


Solution

  • EDIT (2022-07-25)

    GemBox.Document's rendering engine now has support for floating tables that span over multiple pages.

    This improvement is available starting with this bugfix: https://www.gemboxsoftware.com/document/nightlybuilds/GBD35v1058.zip

    Or this NuGet package:
    Install-Package GemBox.Document -Version 35.0.1058-hotfix

    ORIGINAL

    Is it possible that you have a floating Table element ("Text wrapping" set to "Around")?
    If so I believe that is the reason for this issue, to resolve it try setting the Table's layout to an inline ("Text wrapping" set to "None").

    In other words, check the following:

    Word document Table properties

    I hope this helps.