Created using the maui blazor template
Nuget:
Microsoft.Extensions.Caching.Memory (Not adding will report an error)
Syncfusion.Blazor.Core
Syncfusion.Blazor.PdfViewerServer.Linux
Syncfusion.Blazor.Themes
MauiProgram:
builder.Services.AddMemoryCache();
builder.Services.AddSyncfusionBlazor();
index.html:
<link rel='nofollow' href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
<script src="_content/Syncfusion.Blazor.PdfViewer/scripts/syncfusion-blazor-pdfviewer.min.js" type="text/javascript"></script>
Page:
@using Syncfusion.Blazor.PdfViewerServer
<SfPdfViewerServer DocumentPath="@DocumentPath" Height="500px" Width="1060px"></SfPdfViewerServer>
private string DocumentPath { get; set; }
protected override void OnInitialized()
{
string Url = "https://www.syncfusion.com/license/studio/20.4.0.38/syncfusion_essential_studio_eula.pdf ";
System.Net.WebClient webClient = new System.Net.WebClient();
byte[] byteArray = webClient.DownloadData(Url);
DocumentPath = "data:application/pdf;base64," + Convert.ToBase64String(byteArray);
}