Load Pages on Demand
The PDFViewer supports loading pages on demand, which is ideal for large PDF files. The feature improves the performance by loading only the necessary pages during initialization, reducing the initial loading time and memory consumption.
The PDFViewer will load the pages as the user scrolls through the document, ensuring a smooth experience without overwhelming the browser with too much data at once.
To enable this functionality, set the loadOnDemand
property to true
.
You can control the number of pages loaded at a time using the loadOnDemandPageSize
property. By default, this property is set to 1
, meaning that one page is loaded initially, and the following pages are requested as the user scrolls. Adjust this value to load multiple pages simultaneously if needed.
<kendo-pdfviewer
[loadOnDemand]="true"
[loadOnDemandPageSize]="2">
</kendo-pdfviewer>
The following example demonstrates how to load pages on demand in the PDFViewer component.