I'm running into issues where the RadPdfViewer does not want to let go of the file stream. What is the best way to clear the viewer and prepare for a refresh of the document?
1 Answer, 1 is accepted
0
Didi
Telerik team
answered on 06 Oct 2025, 11:41 AM
Hi,
The PDF Viewer control implements read-on-demand loading, and each page of the document loads dynamically only when it is shown in the PDF Viewer. When that page isn't in the view area, it gets unloaded. The stream that holds the document stays opened while the document is used in PDF Viewer.
to close the stream set the Source property of RadPdfViewer to null.
pdfViewer.Source = null;
For more details on displaying documents in RadPdfViewer:
Your perspective matters! Join other professionals in the State of Designer-Developer Collaboration 2025: Workflows, Trends and AI survey to share how AI and new workflows are impacting collaboration, and be among the first to see the key findings. Start the 2025 Survey
The samples provided by Telerik load .Source with a stream which is what I has doing. It wasn't clear at all that I could just set .Source to a byte array. Doing this instead, solved my problem. Appreciate the help with that link. :)