Trying to save the document in an SfPdfViewer from ViewModel instead of code behind

Hi,

I was going through the following link:

https://www.syncfusion.com/kb/9031/how-to-save-loaded-pdf-document-in-application-level

and I was wondering if there is a way to do the following from ViewModel instead of code behind: 

  1. private void PdfViewerControl_DocumentSaveInitiated(object sender, Syncfusion.SfPdfViewer.XForms.DocumentSaveInitiatedEventArgs args)        
  2.          {   string filePath = DependencyService.Get<ISave>().Save(args.SaveStream as MemoryStream);
  3.             string message = "The PDF has been saved to " + filePath;
  4.             DependencyService.Get<IAlertView>().Show(message);
  5.         }
Thank you,
Madhu

2 Replies 1 reply marked as answer

AV Ashokkumar Viswanathan Syncfusion Team June 25, 2020 08:43 AM UTC

Hi Madhu, 
 
Greetings from Syncfusion support, 
 
We have created a simple sample where saving of PDF document is done in the ViewModel instead of Code behind.  
 
Please find the sample in the below link, 
 
Please try the above sample and Let us know whether the above sample resolved your issue. 
 
Regards, 
Ashok Kumar Viswanathan. 


Marked as answer

MG Madhu Ganesh June 26, 2020 03:42 AM UTC

This fixed my problem

Thank you

Loader.
Up arrow icon