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

Unable to Load the PDF

2 Answers 30 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Ramesh
Top achievements
Rank 1
Ramesh asked on 27 Nov 2013, 09:24 AM
  Hi ,

I am using  RadPdfViewe but unable to load the PDF .

Iam following bellow link http://www.telerik.com/help/silverlight/radpdfviewer-showing-a-file.html for reference


my requirment is I have a PDF file in C:\Ramesh\Books\Sample.pdf .

How can I load it  when I click on a button .


Bellow is my code kindly help me .



 

<UserControl x:Class="PDFViewerTelerikDemoMVVM.MainPage"
    xmlns:x=6/xaml"
              
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
 
    <Grid x:Name="LayoutRoot" Background="White">
 
        <telerik:RadPdfViewer x:Name="pdfViewer" DocumentSource="PDFViewerTelerikDemoMVVM;component/SampleData/Pro.Silverlight.5.in.CSharp.4th.Edition.pdf"  Height="Auto" Width="Auto"/>
 
        <!--DocumentSource="PDFViewerTelerikDemoMVVM;component/SampleData/Pro.Silverlight.5.in.CSharp.4th.Edition.pdf"-->
 
    </Grid>
</UserControl>

2 Answers, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 29 Nov 2013, 03:08 PM
Hello Ramesh,

Thank you for contacting us!

Due to limitation of Silverlight, the file system is a subject of security restrictions. That is why you cannot open a file (in your case "C:\Ramesh\Books\Sample.pdf" ) from your local drive without using Open File Dialog. As far as our research shows, out-of-browser applications with elevated trust might allow you access to such files. 

In order to make the code you sent us work and load a file with Path PDFViewerTelerikDemoMVVM;component/SampleData/Pro.Silverlight.5.in.CSharp.4th.Edition.pdf you need to set the Build Action property of the pdf file to Resource.

Don't hesitate to contact us again!

Regards,
Svetoslav
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Ramesh
Top achievements
Rank 1
answered on 04 Dec 2013, 12:27 PM
Hi ,

Thank you so much it is working fentastic
Tags
PDFViewer
Asked by
Ramesh
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Ramesh
Top achievements
Rank 1
Share this question
or