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)