Search code examples
wpfdevexpress-wpf

PdfViewerControl in devexpress shows a white background while loading PDF file


While loading the PDF file a white background is showed inside the control . How to remove the white background.

This is the way i use pdf viewer control in xaml

<dxpdf:PdfViewerControl AsyncDocumentLoad="True" x:Name="testView" ShowOpenFileOnStartScreen="False" ShowStartScreen="False"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  CommandBarStyle="None"/>

and in code behind

 testView.DocumentSource = "D:\\test.pdf";
            testView.ZoomMode = DevExpress.Xpf.DocumentViewer.ZoomMode.FitToWidth;

Solution

  • I got it myself

      Application.Current.Dispatcher.BeginInvoke(
      DispatcherPriority.Background,
      new Action(() => { testView.DocumentSource = "D:\\test.pdf"; testView.ZoomMode = DevExpress.Xpf.DocumentViewer.ZoomMode.FitToWidth; }));