@page "/"
@using System;
@using Syncfusion.Blazor.PdfViewer;
@using Syncfusion.Blazor.PdfViewerServer;
@using Microsoft.EntityFrameworkCore;
@using Syncfusion.Blazor.Buttons


<SfButton @onclick="LoadPdf">Load Document</SfButton>
<!--PDF does only load the document when i scroll no license included because it is just an example. Kind regards-->
<SfPdfViewerServer @ref="viewer" Height="100%" Width="100%" ZoomValue="100">
    <PdfViewerEvents></PdfViewerEvents>  <!--Is not triggered in case of faulty loading::  ImportFailed="LoadPdf" DocumentLoadFailed="LoadPdf"-->
</SfPdfViewerServer>



@code {


    private SfPdfViewerServer viewer;
    private byte[] documentAsByteArray { get; set; }

    protected async override Task OnInitializedAsync()
    {

        await base.OnInitializedAsync();
    }



    public async Task LoadPdf()
    {
        documentAsByteArray = System.IO.File.ReadAllBytes("wwwroot/Data/example.pdf");
        await viewer.Load(documentAsByteArray,null);
    }

}