Hi,
In c# I am saving an RTF to DOCX. Using
var spireDoc = new Spire.Doc.Document();
spireDoc.LoadRtf(@"c:\temp\" + TempOverFileName);
spireDoc.SaveToFile(@"c:\temp\" + OverFileName, Spire.Doc.FileFormat.Docx);
But I'm finding it is adding a Section Break at end of document when it is saving (and so there is a blank page at the end of the document). Please see attached rtf and docx version of the file.
Although the section break doesn't appear on the RTF document, I've tried removing all breaks in the document using the following code between the load and the save:
for (int j = 0; j < spireDoc.Sections[0].Paragraphs.Count; j++)
{
Spire.Doc.Documents.Paragraph p = spireDoc.Sections[0].Paragraphs[j];
for (int i = 0; i < p.ChildObjects.Count; i++)
{
var obj = p.ChildObjects[i];
if (obj.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.Break)
{
Spire.Doc.Break b = obj as Spire.Doc.Break;
p.ChildObjects.Remove(b);
}
}
}
But either with or without this code, a Section Break (New Page) is being added to the end of the document.
Many thanks for any assistance that can help remove this Section Break.