RadPdfViewer - best way to release the stream of the PDF

1 Answer 9 Views
PDFViewer
Robbe
Top achievements
Rank 1
Iron
Robbe asked on 05 Oct 2025, 03:18 PM
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

Sort by
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:

    Regards,
    Didi
    Progress Telerik

    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
    Robbe
    Top achievements
    Rank 1
    Iron
    commented on 06 Oct 2025, 02:14 PM

    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.  :)
    Tags
    PDFViewer
    Asked by
    Robbe
    Top achievements
    Rank 1
    Iron
    Answers by
    Didi
    Telerik team
    Share this question
    or