The PDF document in the PDF viewer is saved in the application level. PDF viewer returns the PDF document along with the changes made (annotations addition and modification) as stream when tapping the save button in the default toolbar as an event argument of the DocumentSaveInitiated event. This stream is saved as a file locally in Xamarin Forms Android, iOS, and UWP platforms by using DependencyService in Xamarin.Forms. These platform specific saving options are used by defining an interface in the portable project. Refer to the following code snippets.
Define the following interface.
Load the PDF to PdfViewer and invoke save method with the stream obtained from the DocumentSaveInitiated event using DependencyService. Then, give the name of the interface as type parameter to the method DependencyService.Get<T>().
Implement the interface in the platform projects with the available platform specific saving options.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|