Strange - Viewer simply doesn't work when viewer type is set to png or jpg

This is with viewer for .NET.
Viewer simply doesn’t work when viewer type is set to png or jpg. please find screenshot attached. This is for all pdfs, and problem is easily reproducible when viewer type is set to jpg/png.
As this is major blocker, appreciate some workaround or quick fix.

image.png (60.1 KB)
image.png (32.6 KB)

@sachinerande

The ViewerType should be set twice when configuring UI and API. Please check this sample application as an example.

ViewerType viewerType = ViewerType.Png;

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

builder.Services
        .AddControllers()
        .AddGroupDocsViewerSelfHostApi(config =>
        {
            //config.SetLicensePath("GroupDocs.Viewer.lic");
            config.SetViewerType(viewerType);
        })

Please let us know if it works for you.

1 Like

Thanks @vladimir.litvinchik, it works.
Is there any good documentation around these methods? e.g. AddGroupDocsViewerSelfHostApi what it does.

@sachinerande

Great, thank you for the feedback. The only documentation that is available at the moment is project README and the code itself. For example, you can find the source code of AddGroupDocsViewerSelfHostApi method here.

1 Like