How to open a file and get a Stream with PDF that contains a password

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).



1 Reply

KE Kathiravan Elangovan Syncfusion Team December 4, 2017 12:55 PM UTC

Hi Ericka,

Thank you for contacting Syncfusion support.

A support incident to track the status of your requirement “Load the password protected PDF document in our PDF viewer control from ViewModel” has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents 

Regards,
Kathiravan E


Loader.
Up arrow icon