Aspose.Words does not Generate the Same Page Break as MS Word does using .NET | SplitPgBreakAndParaMark

Hey,

I noticed that the page break and paragraph break are splitted apart, although the CompatibilityOptions.SplitPgBreakAndParaMark is set to false for document.

The example of code is:

var document = new Document();
document.CompatibilityOptions.SplitPgBreakAndParaMark = false;
var builder = new DocumentBuilder(document);
builder.Write("test");
builder.InsertBreak(BreakType.PageBreak);
document.Save(@"D:\pageBreakTest.docx");

example.zip (18.8 KB)

When I added page break manually on created document the page break and paragraph mark are splitted, but they are no, when break is inserted by API.

Can you take a look at, please?

Thanks,
Mateusz

@acturisaspose

We have logged this problem in our issue tracking system as WORDSNET-22501. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@acturisaspose

Your are facing the expected behavior of Aspose.Words. You should use DocumentBuilder.Writeln method to get expected result. The SplitPgBreakAndParaMark option controls next to page break paragraph behavior.