I am getting this error when loading some PDF files with the WPF PdfViewer, as reported within the PdfViewer control:
Error in loading the PDF document. The complete stack trace is as given below
at Syncfusion.Windows.PdfViewer.PdfViewerControl.Load(Stream stream)
I am using the following code to load and display the documents within the viewer.
using var docStream = File.OpenRead(filePath);
var pdfViewer = new PdfViewerControl(){ Name = filename.Split('.')[0].Replace(' ', '_'), ItemSource = docStream };
dockingManager.Children.Add(pdfViewer);
DockingManager.SetHeader(pdfViewer, filename);
DockingManager.SetState(pdfViewer, DockState.Document);
I cannot share these documents here since they are part of a copyrighted application.
I could share one of the documents privately under "fair use" if you need it to troubleshoot this issue.