Display a pdf document stored in a memory stream using SfPdfViewer

I want to display a pdf document which is stored in a memory stream using SfPdfViewer (please note that I do not want to use SfPdfViewerServer, because installing SyncFusion.PdfViewerServer.Windows introduces hundreds of symbol conflicts, since that package obviously pulls the entire SyncFusion.Blazor package into my assembly, while I am working with individual SyncFusion packages as needed by me).

    
<SfPdfViewer DocumentPath=@DocumentPath Width="100%" Height="100%" />

@code {
MemoryStream? pdfDocument = null;
string imageData = string.Empty;

// before calling this, a test document is loaded into pdfDocument
string DocumentPath
{
get {
if (pdfDocument != null)
imageData = "data:application/pdf;base64," +
Convert.ToBase64String(pdfDocument.ToArray());
return imageData;
}
}

}

Problem is that the PdfViewer control only shows a blank page and no content of the pdf file (which is a non empty multi page document).


2 Replies

VS Vasugi Sivajothi Syncfusion Team June 15, 2022 04:27 AM UTC

Hi Dietfrid,


Currently, we are checking the reported issue with the provided details. We will analyze further on this and update the details on or before June 16, 2022.


Regards,

Vasugi.





VS Vasugi Sivajothi Syncfusion Team June 17, 2022 04:13 AM UTC

Hi Dietfrid,


Thank you for your patience. We were unable to reproduce the reported issue on our end. We have shared the sample for your reference which can be downloaded from the below link.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorWebAssembly-947791290



Kindly try this and revert to us with the modified sample to replicate the reported issue on our end. This will be helpful to investigate further and provide the solution at the earliest.


Regards,

Vasugi.


Loader.
Up arrow icon