I currently have a project where all my pdf contain a password.
I need to display the PDF but I can't create the Stream in order to open the file.
My current pattern is MVVM so I have a binding to the ItemSource which requires a Stream. If there is a better way use MVVM I open to try.
My View
""
I can't figure out how to get the stream when the file contains a password.
I can user var pdfDocument = await PdfDocument.LoadFromFileAsync(file, "FakePassword");
But this gives me a windows.data.pdf.pdfDocument that not sure how to use with PdfViewerControl.
or
PdfLoadedDocument doc = new PdfLoadedDocument();
await doc.OpenAsync(file, "FakePassword");
But I can only use this to set the Element Name "PdfViewerControl" property which I don't know how to get access too from my ViewModel and not the codebehind (codebehind is easy).