@page "/pdfviewer" PDF Viewer

PDF Viewer

@code { byte[]? DocumentContent { get; set; } protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); await using Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("EnvelopeGenerator.ReceiverUI.Web.Client.Documents.Invoice.pdf") ?? throw new InvalidOperationException("Resource not found."); using MemoryStream ms = new(); await stream.CopyToAsync(ms); DocumentContent = ms.ToArray(); } }