-1

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

Hasan Zubairi
  • 1,037
  • 4
  • 23
  • 57

1 Answers1

0

Found the solution. Should be like this

pdfViewer.DocumentSource = new PdfDocumentSource(new Uri("c:\\temp\\Test.pdf"));
Hasan Zubairi
  • 1,037
  • 4
  • 23
  • 57
  • when prefixing a string with `@`, you dont need to escape slashes. `@"c:\temp\Test.pdf"` or `"c:\\temp\\Test.pdf"` would work – highboi Mar 07 '17 at 16:18