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

DocumentSource Problem

1 Answer 15 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
hrn
Top achievements
Rank 1
hrn asked on 19 Feb 2014, 09:12 AM
Hi,

i have a problem with radpdfviewer. You can look attach pictures. I want to read GelenEvrak/Kitap.pdf but i cant open in radpdfviewer. how am i read it

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 21 Feb 2014, 09:03 AM
Hello,

Thank you for contacting us.
You can read this article which explains how to show a file in RadPdfViewer.  The following code snippet shows how to load a file embedded as a resource:
private void LoadFromStream(object sender, System.Windows.RoutedEventArgs e)
{
    Stream str = App.GetResourceStream(new System.Uri("PdfViewerDemo;component/SampleData/Sample.pdf", System.UriKind.Relative)).Stream;
    this.pdfViewer.DocumentSource = new PdfDocumentSource(str);
}
You also need to set the Build Action of the document you want to load to "Resource".

I hope this is helpful. Please, do not hesitate to contact us if you have any other questions.

Regards,
Alexander
Telerik
Tags
PDFViewer
Asked by
hrn
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or