Aspose graph issue

Hello, I am getting a graph overlapping issue while processing a word document using Aspose. I have attached the document as well. In the original document, on page 22 and 23, there are overall 3 graphical images. When I process the document using below code, the third graph gets overlapped over the second graph which makes the second graph hidden and we will only see a total of 2 graph. Below is the code I’m using to process the document.

static void Main(string[] args)
{
    try
    {
        Document doc = new Document(@"C:\TEMP\Original.docx");
        Aspose.Words.Document document = doc;
        foreach (Aspose.Words.Section section in document)
        {
            Aspose.Words.HeaderFooter Header;
            Header = section.HeadersFooters[Aspose.Words.HeaderFooterType.HeaderPrimary];
            var Header2 = section.HeadersFooters[Aspose.Words.HeaderFooterType.HeaderFirst];
            var header3 = section.HeadersFooters[Aspose.Words.HeaderFooterType.HeaderEven];
            if (Header != null)
                Header.Remove();
            if (Header2 != null)
                Header2.Remove();
            if (header3 != null)
                header3.Remove();
        }
        foreach (Aspose.Words.Section section in document)
        {
            Aspose.Words.HeaderFooter Header;
            Header = section.HeadersFooters[Aspose.Words.HeaderFooterType.HeaderPrimary];
            section.PageSetup.HeaderDistance = 36;
            section.PageSetup.TopMargin = 36;
            section.PageSetup.FooterDistance = 36;
            section.PageSetup.BottomMargin = 36;
        }
        document.UpdatePageLayout();
        document.UpdateFields();
        try
        {
            Aspose.Words.Saving.SaveOutputParameters objSave = doc.Save(@"C:\Temp\out.docx", SaveFormat.Docx);
        }
        catch (Exception)
        {

            throw;
        }
    }
    catch (Exception ex)
    {
        throw;
    }
}

Original.docx (2.5 MB)

@vasudevan As you may know MS Word documents are flow document and there is no “page” concept. In your code page margins are changed, so the document’s content is reflowed. As a result one floating shape overlaps another floating shape. The same occurs if you change top and bottom margins to 36pt in MS Word.

Hi, Thank you for the quick response.
36 pt is equal to 0.5 inches. By default the original document is set to 0.5 inches header and footer margin, so I believe removing the margin and adding the same margin distance is not supposed to make any differences in the document’s content. Moreover, I was not able to replicate the issue in the Word application itself when I set the margins to 0 and back to 0.5 inches.
Could you please clarify?

@vasudevan Please see the attached document where top and bottom margins are chnaged to 36pt in MS Word: changed.docx (2.5 MB)