Free Support Forum -

Title with KeepWithNext + long paragraph with KeepTogether


In order to avoid an orphan title, I declare this title with “KeepWithNext = true”.
On the other side, the paragraph just after this title is declared with “KeepTogether = true”, so that a page break is inserted if the paragraph goes over the next page.

When the prargraph is short enough, it works well (page break only before the title)
But, when the paragraph is longer than an entire page, a page break is inserted before AND after the title, so the title is orphan, alone on a blank page :

[… content …]
---- page break ----
[The Title]
---- page break ----
[The paragraph]

Am I missing something ?

Thanks in advance for your help,



Thanks for your inquiry. Please note that Aspose.Words mimic the behavior of MS Word. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

@tahir.manzoor ,

Thanks for your reply.
Indeed, I didn’t notice it’s a MS Word behavior. Sorry about that.
We can close the topic, thanks.

FYI, I send you a simple console application that shows this behavior :
Aspose (20.2 KB)


Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.