Cannot load a PDF document from file.

4 posts, 0 answers
  1. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 24 Sep 2014 Link to this post


    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?!?

  2. Deyan
    Deyan avatar
    158 posts

    Posted 29 Sep 2014 Link to this post

    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.

    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.
  3. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 03 Oct 2014 in reply to Deyan Link to this post

    Hi Deyan,

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

  4. Todor
    Todor avatar
    168 posts

    Posted 07 Oct 2014 Link to this post

    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.


    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.

Back to Top