I have a PDF file that's been imported into a MemoryStream object and now I need to display it using the Telerik UI for WPF pdfViewer control. The existing documentation says that you can create a PdfDocumentSource object and bind the pdfViewer.DocumentSource to that. However, either PdfDocumentSource no longer exists, or I can't figure out what the correct Namespace is.
I'm using TelerikUI for WPF v2024 Q2. However changelogs for 2020 (https://docs.telerik.com/devtools/wpf/controls/radpdfviewer/changes-and-backward-compatibility/backward-compatibility) say that:
Changed
Obsolete constructors of Telerik.Windows.Documents.Fixed.PdfDocumentSource:
PdfDocumentSource(Uri uri, FormatProviderSettings settings)
PdfDocumentSource(Stream stream, FormatProviderSettings settings)
What to do now
Use the overloads that accept Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.PdfImportSettings instead.
I've also read that there is some kind of merge going on trying to replace the previous PDF code with Telerik.Windows.Documents.Fixed . In any case, I can't seem to figure out how to go from a MemoryStream to something that the pdfViewer.DocumentSource likes.
Can anyone help with a very basic code sample to take a PDF as a memorystream and create something that pdfView.DocumentSource will accept? Thank you!