Create PowerPoint file in Xamarin

GemBox.Presentation is a standalone .NET component with cross-platform support. You can use it on non-Windows platforms like Xamarin and Mono, enabling you to run it on Android and iOS mobile devices.

With GemBox.Presentation you can process your presentations (read, write, convert, and edit PowerPoint files) from the native mobile apps.

The following example shows how you can create a PowerPoint file in Xamarin.Forms mobile application.

PowerPoint file generator on a native Android mobile app with Xamarin.Forms
Screenshot of Xamarin Android app that creates a PowerPoint file
<ContentPage xmlns=""

    <StackLayout Padding="50" 

        <Label Text="GemBox.Presentation Example"
               Margin="0,0,0,30" />

        <Editor x:Name="text"
                Text="Hi! This presentation was generated with GemBox.Presentation library." />

        <ActivityIndicator x:Name="activity" />

        <Button x:Name="button"
                Text="Create presentation"

using System;
using System.ComponentModel;
using System.IO;
using System.Threading.Tasks;
using Xamarin.Essentials;
using Xamarin.Forms;
using GemBox.Presentation;

public partial class MainPage : ContentPage
    public MainPage()

    private string CreatePresentation()
        var presentation = new PresentationDocument();

            .Content.AddTextBox(ShapeGeometryType.Rectangle, 2, 2, 10, 4, LengthUnit.Centimeter)

        var filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Example.pptx");


        return filePath;

    private async void Button_Clicked(object sender, EventArgs e)
        button.IsEnabled = false;
        activity.IsRunning = true;

            var filePath = await Task.Run(() => CreatePresentation());
            await Launcher.OpenAsync(new OpenFileRequest(Path.GetFileName(filePath), new ReadOnlyFile(filePath)));
        catch (Exception ex)
            await DisplayAlert("Error", ex.Message, "Close");

        activity.IsRunning = false;
        button.IsEnabled = true;
Imports System
Imports System.ComponentModel
Imports System.IO
Imports System.Threading.Tasks
Imports Xamarin.Essentials
Imports Xamarin.Forms
Imports GemBox.Presentation

Partial Public Class MainPage
    Inherits ContentPage

    Public Sub New()
    End Sub

    Private Function CreatePresentation() As String
        Dim presentation As New PresentationDocument()

        .Content.AddTextBox(ShapeGeometryType.Rectangle, 2, 2, 10, 4, LengthUnit.Centimeter)

        Dim filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Example.pptx")


        Return filePath
    End Function

    Private Async Sub Button_Clicked(sender As Object, e As EventArgs)
        button.IsEnabled = False
        activity.IsRunning = True

            Dim filePath = Await Task.Run(Function() CreatePresentation())
            Await Launcher.OpenAsync(New OpenFileRequest(Path.GetFileName(filePath), New ReadOnlyFile(filePath)))
        Catch ex As Exception
            Await DisplayAlert("Error", ex.Message, "Close")
        End Try

        activity.IsRunning = False
        button.IsEnabled = True
    End Sub
End Class

Limitations on Android or iOS

You can use the full functionality of GemBox.Presentation on the Xamarin applications, but with the following exceptions:

These features currently have WPF dependencies which means they require a .NET Windows Desktop Runtime. However, we do have plans for providing cross-platform support for them in future releases.

Want more?

Next example GitHub

Check the next example or select an example from the menu. You can also download our examples from the GitHub.

Like it?

Download Buy

If you want to try the GemBox.Presentation yourself, you can download the free version. It delivers the same performance and set of features as the professional version, but with some operations limited. To remove the limitation, you need to purchase a license.