We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to share the PDF document in Xamarin.Forms platform?

PDF documents can be shared by saving the loaded PDF to the file system using the SaveDocument API and share the saved PDF. Refer to the following code snippets.

Portable

Add an interface to the PCL project which defines a method that shares the saved PDF document.

C#

 

Add another interface to save the loaded PDF to the file system.

C#

public interface ISave

{

    string Save(MemoryStream fileStream);

}

 

Get the saved file path using the Save method defined in ISave and use this as an argument to share the file using Show method of IShare interface. 

C#

 

Android

Implement IShare with file sharing options available in Android platform.

C#

 

Implement ISave with file write options available in Android platform.

C#

 

iOS

Implement IShare with file sharing options available in iOS platform.

C#

 

Implement ISave with file write options available in iOS platform.

C#

 

UWP

Implement IShare with file sharing options available in UWP platform.

C#

 

Implement ISave with file write options available in UWP platform.

C#

 

Sample link:

http://www.syncfusion.com/downloads/support/directtrac/general/ze/GettingStarted_PDFViewer-1659303577

 

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework:
8706 04/17/2018 04/17/2018 Xamarin.Android SfPdfViewer 4.5.1
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.