Blazor PDF Viewer doesn't load base64 code

Hello, there

I'm having the following problem using the PDF Viewer, it keeps loading:


I checked the configurations in index.html, program.cs, startup.cs.

I added this line in my Startup.cs file:

services.AddServerSideBlazor().AddHubOptions(o => { o.MaximumReceiveMessageSize = 102400000; });


I also checked if I'm dowloading the right libraries in index.html:


It seems to be all correct, still it doesn't work. My project has Client, Server, Shared (Client-server architecture), so I think that some configurations might be different from the sample I've seen.

Could you try to execute the sample I'm sending to see if there's something wrong?


Attachment: My_project_sample_7fc628fe.zip

3 Replies 1 reply marked as answer

VV Visvesvar Venkatesan Syncfusion Team May 26, 2023 06:22 PM UTC

The sample you provide is on a hosted environment basis. For hosted environment, you need to add service Url and you must use PDF Viewer alone and not PDFViewer server.


Kindly find the code changes below to render the PDF.



    <SfPdfViewer Width="100%" Height="100%" @ref="viewer" ServiceUrl="https://blazor.syncfusion.com/services/production/api/pdfviewer" DocumentPath="@DocumentPath">

    </SfPdfViewer>


public string DocumentPath { get; set; } = "wwwroot/data/PDF_Succinctly.pdf";

    public string Path { get; set; }

 

    SfPdfViewer viewer;



Kindly try it and let us know if you have any concerns.


Marked as answer

ED Eduardo May 28, 2023 01:10 AM UTC

It works!

Thank you very much!



VV Visvesvar Venkatesan Syncfusion Team May 29, 2023 08:08 AM UTC

Thank you for your update. We are closing this ticket now.


Loader.
Up arrow icon