This is a migrated thread and some comments may be shown as answers.

PdfViewer without locking file on FS

1 Answer 101 Views
PdfViewer and PdfViewerNavigator
This is a migrated thread and some comments may be shown as answers.
Den Duze
Top achievements
Rank 1
Den Duze asked on 19 Jan 2017, 09:54 AM

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

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 19 Jan 2017, 12:00 PM
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.
Tags
PdfViewer and PdfViewerNavigator
Asked by
Den Duze
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or