RadPdfViewer (Read PDF Build Action Property None)

2 posts, 0 answers
  1. DRIDI
    DRIDI avatar
    1 posts
    Member since:
    May 2015

    Posted 21 May 2015 Link to this post


    I have an issue with reading PDF files. If I change BuildAction property via VisualStudio from none to resource it works but if I keep none it doesn't work. The PDF files are dynamically added to the folder by the user. Is there a way to solve this problem, I mean a way to read the PDF files without changing the BuildAction property  ?


    Thanks in advance.

    <telerik:RadPdfViewer Grid.Row="1" x:Name="pdfViewer" DataContext="{Binding ElementName=pdfViewer, Path=CommandDescriptors}">

    this.pdfViewer.DocumentSource = new PdfDocumentSource(new Uri("MyProject;component/Contenu/PDF/Facture.pdf", UriKind.Relative));

  2. Tanya
    Tanya avatar
    918 posts

    Posted 22 May 2015 Link to this post

    Hi Dridi,

    This syntax will work only if the document is embedded in the project as a Resource. This option embeds the file into the application and makes it accessible for it.

    In order to show the dynamically added documents, you could read the files using the .NET API, import the document with the PdfFormatProvider and then pass it to the PdfDocumentSource. More information and examples about how to import files you can find in our documentation.

    Hope this helps.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top