If WebViewer is telling you there are MIME types not available or if your server cannot find .res files, you may have to enable MIME type mappings based on the mappings for specific document types.
ASP.NET Server
If you are using an ASP.NET server, which is the default server Blazor uses, this guide shows how to add MIME type mappings.
For example, if you are getting MIME issues while pdf files, then add these lines inside the public void Configure(IApplicationBuilder app, IWebHostEnvironment env) method in Startup.cs of your project:
C#
1var provider = new FileExtensionContentTypeProvider();
Please note you need to use the Microsoft.AspNetCore.StaticFiles, Microsoft.Extensions.FileProviders and System.IO namespaces in your Startup.cs file.
Passing WebViewer elements to .NET Core
If you want to use our .NET Core package to handle document operations, you can pass the PDFDoc loaded into WebViewer through the JavaScript interop by passing its base64 data.
Here's how to convert the loaded document data into a base64 string on the WebViewer side:
On the .NET Core side, you can reconstruct the PDFDoc with the base64 string, perform document operations using our .NET Core SDK, and convert the new document back to base64:
11 return new Blob([bytes], { type: 'application/pdf' });
12}
Increasing file transfer size limit for JavaScript interop
If you are using the ASP.NET server, you may have to increase the interop byte transfer limit to transfer documents. This can be done in the ConfigureServices function in Startup.cs: