How can I help you?
Load specific number of pages on initial rendering in ASP.NET Core
28 Feb 20261 minute to read
The Syncfusion® ASP.NET Core PDF Viewer optimizes initialization performance by rendering only a subset of pages when a document first opens. This approach improves responsiveness for large documents by deferring the rendering of remaining pages until the user scrolls them into view.
Enable initial page rendering
To implement this optimization, use the initialRenderPages property. Assign an integer value representing the number of pages that should be rendered immediately upon document load.
NOTE
A typical optimization range is 5 to 20 pages. Rendering too many pages initially can increase memory consumption and delay the initial display of the viewer.
Examples
The following examples demonstrate how to set the initialRenderPages property in both standalone and server-backed configurations.
@{
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>