PdfViewer without locking file on FS

2 posts, 0 answers
  1. Den Duze
    Den Duze avatar
    16 posts
    Member since:
    Nov 2014

    Posted 19 Jan Link to this post

    Hi,

    I'm using the PdfViewer with succes but when a pdf is loaded that pdf is also locked in the filesystem.
    is there some way to prevent that?
    So I would like to load the pdf and then disconnect form the file while the content is still in de PdfViewer.

    Regards
    Didier

  2. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 19 Jan Link to this post

    Hi Didier,

    You can copy the file stream and then load the document:
    using (FileStream fs = new FileStream(@"C:\test.pdf", FileMode.Open))
    {
        MemoryStream ms = new MemoryStream();
        fs.CopyTo(ms);
        radPdfViewer1.LoadDocument(ms);
     
    }

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top