Load N number of pages on initial loading in ASP.NET Core

The initial rendering in a PDF Viewer allows users to control how many pages appear when opening a PDF document. Loading only a subset of pages can improve responsiveness because the viewer fetches additional pages on demand as the user scrolls, reducing initial download time for large files.

To utilize this capability in Syncfusion® PDF Viewer, use the initialRenderPages property. Set this property to the number of pages that should be visible during the first render. Choose the value carefully for large documents because rendering too many pages at once increases memory usage and can degrade performance.

Using the initialRenderPages property prudently works well when a smaller range of pages, such as 10–20, provides the essential overview users need before scrolling to additional content.

@{
    ViewData["Title"] = "Home page";
    double InitialRenderPages = 5;
}

<div class="text-center">
    <ejs-pdfviewer
        id="pdfviewer"
        style="height:600px"
        initialRenderPages="@InitialRenderPages"
        documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf">
    </ejs-pdfviewer>
</div>
@{
    ViewData["Title"] = "Home page";
    double InitialRenderPages = 5;
}

<div class="text-center">
    <ejs-pdfviewer
        id="pdfviewer"
        style="height:600px"
        serviceUrl="/Index"
        initialRenderPages="@InitialRenderPages"
        documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf">
    </ejs-pdfviewer>
</div>

View sample in GitHub