Images are not in the right place

Hello,

When previewing the Word file, we’re having problems with the images in the documents.
After a few investigations and tests on the parameters of the images in the Word file, nothing was really conclusive.

Please find enclosed:

You can see the problem on page 9 and 10 of the file R2401.0013.docx.

Here’s the code used for the preview

using GroupDocs.Viewer.Options;
using GroupDocs.Viewer.Results;
using System;
using System.IO;

namespace Web.code.Lib.GroupDocsViewer
{
    public class HtmlViewer : IDisposable
    {
        private readonly GroupDocs.Viewer.Viewer viewer;
        private readonly HtmlViewOptions htmlViewOptions;
        private readonly ViewInfoOptions viewInfoOptions;

        private Stream stream;

        public HtmlViewer(string filePath, LoadOptions loadOptions)
        {
            viewer = new GroupDocs.Viewer.Viewer(filePath, loadOptions);
            htmlViewOptions = CreateHtmlViewOptions();
            viewInfoOptions = ViewInfoOptions.FromHtmlViewOptions(htmlViewOptions);
        }

        private HtmlViewOptions CreateHtmlViewOptions()
        {
            HtmlViewOptions htmlViewOptions = HtmlViewOptions.ForEmbeddedResources(
                // The action that will be done before each page informations is read
                pageNumber =>
                {
                    Stream pageStream = new MemoryStream();
                    stream = pageStream;

                    return pageStream;
                },
                // The action to do after each page information is read.
                // Must be there otherwise the stream is disposed and we can't used it anymore
                (pageNumber, stream) =>
                {
                });

            htmlViewOptions.SpreadsheetOptions = SpreadsheetOptions.ForOnePagePerSheet();
            htmlViewOptions.SpreadsheetOptions.TextOverflowMode = TextOverflowMode.HideText;
            htmlViewOptions.SpreadsheetOptions.RenderHeadings = true;

            htmlViewOptions.ExcludeFonts = false;

            return htmlViewOptions;
        }

        public string GetPageContent(int pageNumber)
        {
            viewer.View(htmlViewOptions, pageNumber);
            stream.Position = 0;
            using (StreamReader reader = new StreamReader(stream))
            {
                string htmlContent = reader.ReadToEnd();
                stream.Dispose();
                return htmlContent;
            }
        }

        public void Dispose()
        {
            viewer.Dispose();
        }
    }
}

Version of GroupDocs.Viewer used 24.3.0 (latest).

We’re developing a web application and your solution is being used by our application for customers who want to be able to preview and convert their files correctly.

Thanks in advance

I thinks related to Images are not in the right place when converting pdf for net
R2401.0013.docx (2.61 MB)

@BASSETTI

Thank you for adding the code snippet and source file. I have reproduced this issue. It is a bug. We’ll investigate this issue and update you. The issue ID for reference is VIEWERNET-4792.

@BASSETTI

This issue was fixed see pages-8-9-10.zip (1.2 MB). The fix will be included in GroupDocs.Viewer for .NET 24.4 that is planned to publish by the end of this month. We’ll notify you here when the version will be available.