1

I am trying to stop Aspose PDF from Page Breaking in the middle of my table (C# .NET). We dynamically add information to this PDF, but this table will always be two rows.

I have found the table.isBroken attribute always returns true and row.isRowBroken always returns false (from Aspose). This does not help me to stop the page from breaking in the middle of this table.

I have also tried adjusting the margin to no avail since our pages are dynamic. Google and the Aspose forums and documentation have revealed nothing. I have turned to asking a question here on stackoverflow.com.

Any ideas or suggestions would be helpful! Thank you so much for your time!

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
Edge Developers
  • 519
  • 6
  • 15

1 Answers1

1

You may use RepeatingRowCount property of Table class to set header rows count. It will keep these rows together on page break.

I'm Tilal,developer evangelist at Aspose.

Aspose.Pdf.Table table = new Aspose.Pdf.Table();
table.RepeatingRowsCount = 2;
Tilal Ahmad
  • 940
  • 5
  • 9
  • 1
    That kind of works, except it throws an ArgumentOutOfRangeException. I fixed it by setting table.RepeatingRowsCount = 1; This mostly fixed the problem, however I am still left with a top border for an invisible form header on the previous page. So now there are kind of two form headers, one on the previous page that only shows the top border, and one on the next page that behaves as expected. – Edge Developers Feb 09 '17 at 16:01
  • 2
    Please share your sample code and intended document in your [Aspose.Pdf forum post](https://www.aspose.com/community/forums/824367/table-page-break-pdf/showthread.aspx#824367). We will look into it and guide you accordingly. – Tilal Ahmad Feb 10 '17 at 04:50