Section breaks erased

Issue occurs in Aspose Words 25.6 and later, when calling either of these two methods in com.aspose.words.Document:

  • save(String fileName, int saveFormat)
  • save(String fileName, SaveOptions saveOptions)

Section breaks appear to be erased after calling any of the above to save a document, causing unintended page layout changes, with no changes to the calling code.

On the other hand, calling save(String fileName) appears to preserve section breaks.

This is possibly a duplicate of 318836, however, I am not able to verify it as I do not have access to the attachements there.

@tkaraivanovexperlogix

It appears you are encountering an issue with section breaks being removed when saving documents using certain methods in Aspose.Words 25.6 and later. This behavior has been observed when using save(String fileName, int saveFormat) or save(String fileName, SaveOptions saveOptions), while the method save(String fileName) seems to retain the section breaks.

This may indicate a bug or unintended behavior in the version of the library you are using. As a temporary workaround, I recommend using the save(String fileName) method until this issue is addressed in a future update.

For further assistance, please check the official Aspose forums or documentation for any updates or patches related to this issue. If you have access to any attachments mentioned in the forum post you referenced, reviewing them could provide additional insights.

@tkaraivanovexperlogix Could you please attach your problematic input and output documents along with code that will allow us to reproduce the problem? We will check the issue and provide you more information.

Thanks for reaching out. I’m attaching the source code and a couple of output examples - one for version 25.5 and one for version 25.6(but you can run the code and verify yourself). Input is irrelevant (included in the attachment, but any two word documents wold do).

Archive.zip (67.4 KB)

When appending one document to another with a section starton the second document, it appears that section breaks(column, odd page, even page, continuous) are turned into “new page” section breaks, breaking the layout.

Also, please ignore the part about different save methods exhibiting different behavior. On further testing it appears that the unwanted behavior is present with all save methods in version 25.6 and up.

@tkaraivanovexperlogix
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-28336

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.