Open ManuelHaas opened 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");
Also you can give a try a complete application - sample-app.zip.
@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?
@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.
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.
@ManuelHaas
Can you please attach the PDF file that you're opening? We'll take a look at how we can improve the output.
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:
Test.xlsx in online viewer:
How can I configure GroupDocs Viewer so that Excel documents are displayed in the same way as in your online viewer?
Test.xlsx