Search code examples
c#wpfpdftelerikpdfviewer

Wpf Telerik PDFViewer


In my application I am trying to print a pdf file silently. The code is working fine but it only works with Acrobat and not with reader. I am trying to embed telerik's pdf viewer to print the file in the background without showing it. As a first step I am trying to open a local pdf file in the viewer. I am using the code from the example.

pdfViewer.DocumentSource = new PdfDocumentSource(new System.Uri(@"c:\\temp\\Test.pdf", System.UriKind.Relative));

This code is not giving any errors but it is also not showing the file in the pdf viewer. How can I open a local file with pdf viewer and print it silently?

Thanks


Solution

  • Found the solution. Should be like this

    pdfViewer.DocumentSource = new PdfDocumentSource(new Uri("c:\\temp\\Test.pdf"));