groupdocs-viewer / GroupDocs.Viewer-for-.NET-UI

UI - User Interface for GroupDocs.Viewer for .NET document viewer and automation API.
MIT License
5 stars 2 forks source link

Excel display in demos differs greatly from expected display #53

Open ManuelHaas opened 8 months ago

ManuelHaas commented 8 months ago

Our customers tell us that the display of Excel documents sometimes differs greatly from the expected display. I have therefore compared your ASP.NET Core demo with your online viewer at https://products.groupdocs.app/viewer/total. Your online viewer displays Excel documents much more adequately than the demo (on which we have based our integration). Below are two screenshots of a sample document that I have attached to this ticket:

Test.xlsx in ASP.NET Core demo: image

Test.xlsx in online viewer: image

How can I configure GroupDocs Viewer so that Excel documents are displayed in the same way as in your online viewer?

Test.xlsx

vladimir-litvinchik commented 8 months ago

@ManuelHaas

The online Viewer uses new version of Angular UI that is going to replace the current one. And renders files to PNG instead of HTML so the output looks different. You can configure this demo to work the same using the following code in Program.cs file

ViewerType viewerType = ViewerType.Png;

builder.Services
        .AddGroupDocsViewerUI(config => {
            config.SetViewerType(viewerType);
        });

builder.Services
        .AddControllers()
        .AddGroupDocsViewerSelfHostApi(config =>
        {
            config.SetLicensePath("GroupDocs.Viewer.lic");
            config.SetViewerType(viewerType);
            config.ConfigurePngViewOptions(viewOptions => {
                viewOptions.SpreadsheetOptions = SpreadsheetOptions.ForRenderingByPageBreaks();
                viewOptions.SpreadsheetOptions.RenderGridLines = true;
                viewOptions.SpreadsheetOptions.RenderHeadings = true;
                viewOptions.SpreadsheetOptions.SkipEmptyColumns = true;
                viewOptions.SpreadsheetOptions.SkipEmptyRows = true;
                viewOptions.SpreadsheetOptions.TextOverflowMode = 
                    TextOverflowMode.OverlayIfNextIsEmpty;
                viewOptions.SpreadsheetOptions.DetectSeparator = true;
                //Automatically detect CSV and TSV separator
                viewOptions.SpreadsheetOptions.DetectSeparator = true;
            });
        })
        .AddLocalStorage("./Files")
        .AddLocalCache("./Cache");
view-as-png

Also you can give a try a complete application - sample-app.zip.

ManuelHaas commented 8 months ago

@vladimir-litvinchik This works perfectly. Thank you very much! But here it comes. This works great for Excel documents, but Word or PDF documents look better with the previous rendering. Is it possible to activate this type of rendering only for Excel documents?

vladimir-litvinchik commented 8 months ago

@ManuelHaas

You're welcome!

Unfortunately, changing the output type from HTML to PNG is not possible in the current implementation. The packages were designed in a way where all the configuration is set once during application startup. Also, client-side Angular application is depends on this config.

ManuelHaas commented 8 months ago

I understand. With the ViewerType.Png option, pdf documents are sometimes rendered blurred and unattractive. Text passages can also not be marked etc. A slightly more flexible configuration would be really great here. Perhaps this can be taken into account in a future version.

vladimir-litvinchik commented 8 months ago

@ManuelHaas

Can you please attach the PDF file that you're opening? We'll take a look at how we can improve the output.