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