We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

The pdf viewer in Android Maui Blazor does not work

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);

    }




1 Reply

VV Visvesvar Venkatesan Syncfusion Team February 1, 2023 03:28 PM UTC

We need to know the type of issue you are facing on your end.


We have provided documentation to resolve the issue we faced while running the PDF Viewer in a WSL mode.


Documentation - https://www.syncfusion.com/downloads/support/directtrac/general/ze/RUNBLA~1-482669505.zip


We suspect you are also facing the same issue and the documentation might help to resolve the issue.


If you are facing a different issue kindly provide the video and the sample of the issue to analyze further.



Loader.
Live Chat Icon For mobile
Up arrow icon