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

RadPdfViewer (Read PDF Build Action Property None)

1 Answer 45 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
DRIDI
Top achievements
Rank 1
DRIDI asked on 21 May 2015, 10:06 AM

 Hello,

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));

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 22 May 2015, 02:46 PM
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.

Regards,
Tanya
Telerik
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
Tags
PDFViewer
Asked by
DRIDI
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or