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

Cannot load a PDF document from file.

3 Answers 326 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Christie Admin
Top achievements
Rank 1
Christie Admin asked on 24 Sep 2014, 12:25 PM
Hi,

I'm using the latest version of Telerik and I have a problem opening a PDF file. I created a USerControl which containe a RadPdfViewer and I am unable to load a document PDF file from disk.

Here is the piece of code I use to load my document:

            PdfDocumentSource doc = new PdfDocumentSource(new System.Uri(@"d:\document.pdf"));
            this.Viewer.Document = doc.Document;

The "doc.Document" are always null?!?

Thank's
Alain

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 29 Sep 2014, 08:09 AM
Hello Alain,

Thank you for contacting us. 

For viewing a file in PdfViewer you should set the DocumentSouce property. For more information you may follow this link to showing a file in PdfViewer documentation article.

I hope this is helpful. If you have any other questions or concerns please do not hesitate to contact us again.

Regards,
Deyan
the Telerik team
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Christie Admin
Top achievements
Rank 1
answered on 03 Oct 2014, 03:07 PM
Hi Deyan,

If I use the Office2013 theme, do I have to include special resources in my xaml???

Thank's
Alain
0
Todor
Telerik team
answered on 07 Oct 2014, 08:43 AM
Hi Alain,

In order to use RadPdfViewer with implicit styles, as the Office2013 theme is available only for NoXAML assemblies, you should merge all the necessary resource dictionaries in an appropriate place in your application (e.g. App.xaml file). For RadPdfViewer, the resource dictionaries which should be merged are:
  • System.Windows.xaml (necessary for some of the native MS controls)
  • Telerik.Windows.Controls.xaml
  • Telerik.Windows.Controls.Input.xaml
  • Telerik.Windows.Controls.Navigtion.xaml (if you are using the RadToolBar in your application)
  • Telerik.Windows.Controls.FixedDocumentViewers.xaml
  • Telerik.Windows.Controls.FixedDocumentViewersUI.xaml

I hope this helps.


Regards,
Todor
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PDFViewer
Asked by
Christie Admin
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Christie Admin
Top achievements
Rank 1
Todor
Telerik team
Share this question
or