From f1aa64ee21c3b19116ed03ad1717c256b533474a Mon Sep 17 00:00:00 2001 From: Venkateshmuruganandam Date: Thu, 12 Oct 2023 14:30:20 +0530 Subject: [PATCH 1/5] PPTXtoImage subpage --- ...t-Presentation-to-Image-in-ASP-NET-Core.md | 88 +++++ ...nt-Presentation-to-Image-in-ASP-NET-MVC.md | 104 ++++++ ...rPoint-Presentation-to-Image-in-ASP-Net.md | 98 +++++ ...erPoint-Presentation-to-Image-in-Blazor.md | 343 ++++++++++++++++++ ...werPoint-Presentation-to-Image-in-Linux.md | 120 ++++++ ...owerPoint-Presentation-to-Image-in-MAUI.md | 179 +++++++++ ...PowerPoint-Presentation-to-Image-in-Mac.md | 77 ++++ ...PowerPoint-Presentation-to-Image-in-UWP.md | 95 +++++ ...PowerPoint-Presentation-to-Image-in-WPF.md | 92 +++++ ...werPoint-Presentation-to-Image-in-WinUI.md | 163 +++++++++ ...-Presentation-to-Image-in-Windows-Forms.md | 93 +++++ ...rPoint-Presentation-to-Image-in-Xamarin.md | 182 ++++++++++ .../NuGet-Package-PPTXtoImage.png | Bin 0 -> 40002 bytes 13 files changed, 1634 insertions(+) create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-NET-Core.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-NET-MVC.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-Net.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Blazor.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Linux.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-MAUI.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Mac.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-UWP.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-WPF.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-WinUI.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Windows-Forms.md create mode 100644 File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Xamarin.md create mode 100644 File-Formats/Presentation/Workingwith_UWP/NuGet-Package-PPTXtoImage.png diff --git a/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-NET-Core.md b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-NET-Core.md new file mode 100644 index 000000000..bcda356d5 --- /dev/null +++ b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-NET-Core.md @@ -0,0 +1,88 @@ +--- +title: Convert PowerPoint to Image in ASP.NET Core | Syncfusion +description: Convert PowerPoint to image in ASP.NET Core using .NET Core PowerPoint library (Presentation) without Microsoft PowerPoint or interop dependencies. +platform: file-formats +control: PowerPoint +documentation: UG +--- + +# Convert PowerPoint to Image in ASP.NET Core + +Syncfusion PowerPoint is a [.NET Core PowerPoint library](https://www.syncfusion.com/document-processing/powerpoint-framework/net-core) used to create, read, edit and **convert PowerPoint documents** programmatically without **Microsoft PowerPoint** or interop dependencies. Using this library, you can **convert a PowerPoint to image in ASP.NET Core**. + +## Steps to convert PowerPoint to Image programmatically + +Step 1: Create a new C# ASP.NET Core web application project. + +![Create ASP.NET Core Web project for PowerPoint file](Workingwith_Core/Create-Project-Open-and-Save.png) + +Step 2: Install the [Syncfusion.PresentationRenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.PresentationRenderer.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). + +![Install Syncfusion.PresentationRenderer.Net.Core Nuget Package](Azure_Images/App_Service_Linux/Nuget_Package_PowerPoint_Presentation_to_PDF.png) + +N> Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion license key in your application to use our components. +Step 3: Include the following namespaces in **HomeController.cs**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Presentation; +using Syncfusion.PresentationRenderer; + +{% endhighlight %} +{% endtabs %} + +Step 4: A default action method named Index will be present in **HomeController.cs**. Right click on Index method and select **Go To View** where you will be directed to its associated view page **Index.cshtml**. + +Step 5: Add a new button in the **Index.cshtml** as shown below. + +{% tabs %} +{% highlight HTML %} + +@{ + Html.BeginForm("ConvertPPTXtoImage", "Home", FormMethod.Get); + { +
+ +
+ } + Html.EndForm(); +} + +{% endhighlight %} +{% endtabs %} + +Step 6: Add a new action method **ConvertPPTXtoImage** in HomeController.cs and include the below code snippet to **convert a PowerPoint to image in ASP.NET Core**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +//Open the file as Stream. +using (FileStream fileStream = new FileStream(Data/Input.pptx", FileMode.Open, FileAccess.Read)) +{ + //Open the existing PowerPoint presentation. + using (IPresentation pptxDoc = Presentation.Open(fileStream)) + { + //Initialize the PresentationRenderer to perform image conversion. + pptxDoc.PresentationRenderer = new PresentationRenderer(); + //Convert PowerPoint slide to image as stream. + Stream stream = pptxDoc.Slides[0].ConvertToImage(ExportImageFormat.Jpeg); + //Reset the stream position. + stream.Position = 0; + //Download image in the browser. + return File(stream, "application/jpeg", "PPTXtoImage.Jpeg"); + } +} + +{% endhighlight %} +{% endtabs %} + +You can download a complete working sample from GitHub. + +By executing the program, you will get the **image** as follows. + +![PowerPoint to Image in ASP.NET Core](PPTXtoPDF_images/Output_PowerPoint_Presentation_to-Image.png) + +Click [here](https://www.syncfusion.com/document-processing/powerpoint-framework/net-core) to explore the rich set of Syncfusion PowerPoint Library (Presentation) features. + +An online sample link to [convert PowerPoint Presentation to image](https://ej2.syncfusion.com/aspnetcore/PowerPoint/PPTXToImage#/material3) in ASP.NET Core. \ No newline at end of file diff --git a/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-NET-MVC.md b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-NET-MVC.md new file mode 100644 index 000000000..58021c89d --- /dev/null +++ b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-NET-MVC.md @@ -0,0 +1,104 @@ +--- +title: Convert PowerPoint to Image in ASP.NET MVC | Syncfusion +description: Convert PowerPoint to image in ASP.NET MVC using .NET PowerPoint library (Presentation) without Microsoft PowerPoint or interop dependencies. +platform: file-formats +control: PowerPoint +documentation: UG +--- + +# Convert PowerPoint to Image in ASP.NET MVC + +Syncfusion PowerPoint is a [.NET PowerPoint library](https://www.syncfusion.com/document-processing/powerpoint-framework/net) used to create, read, edit and convert PowerPoint documents programmatically without **Microsoft PowerPoint** or interop dependencies. Using this library, you can **convert a PowerPoint to image in ASP.NET MVC**. + +## Steps to convert PowerPoint to Image programmatically + +Step 1: Create a new C# ASP.NET MVC application project. + +![Create ASP.NET MVC project](Workingwith_MVC/Project-Open-and-Save.png) + +Step 2: Select the **MVC** template to create the project. + +![Select MVC template](Workingwith_MVC/MVC-Open-and-Save.png) + +Step 3: Install the [Syncfusion.Presentation.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.Presentation.AspNet.Mvc5) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). + +![Install Syncfusion.Presentation.AspNet.Mvc5 Nuget Package](Workingwith_MVC/Nuget-Package-PPTXtoImage.png) + +N> Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion license key in your application to use our components. + +Step 4: Include the following namespace in that **HomeController.cs** file. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Presentation; + +{% endhighlight %} +{% endtabs %} + +Step 5: A default action method named **Index** will be present in HomeController.cs. Right click on this action method and select **Go To View** where you will be directed to its associated view page **Index.cshtml**. + +Step 6: Add a new button in the Index.cshtml as shown below. + +{% tabs %} +{% highlight HTML %} + +@{ + Html.BeginForm("ConvertPPTXtoImage", "Home", FormMethod.Get); + { +
+ +
+ } + Html.EndForm(); +} + +{% endhighlight %} +{% endtabs %} + +Step 7: Add the below code snippet in **HomeController.cs** to **convert a PowerPoint to image in ASP.NET MVC**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +public void ConvertPPTXtoImage() +{ + //Open the file as Stream. + using (FileStream pathStream = new FileStream(Server.MapPath("~/App_Data/Input.pptx"), FileMode.Open, FileAccess.Read)) + { + //Opens a PowerPoint Presentation. + using (IPresentation pptxDoc = Presentation.Open(pathStream)) + { + //Convert the first slide into image. + Image image = pptxDoc.Slides[0].ConvertToImage(Syncfusion.Drawing.ImageType.Metafile); + //Saves the image file to MemoryStream. + MemoryStream stream = new MemoryStream(); + //Download image file in the browser. + ExportAsImage(image, "PPTXToImage.Jpeg", ImageFormat.Jpeg, HttpContext.ApplicationInstance.Response); + } + } +} +//To download the image file. +protected void ExportAsImage(Image image, string fileName, ImageFormat imageFormat, HttpResponse response) +{ + if (ControllerContext == null) + throw new ArgumentNullException("Context"); + string disposition = "content-disposition"; + response.AddHeader(disposition, "attachment; filename=" + fileName); + if (imageFormat != ImageFormat.Emf) + image.Save(response.OutputStream, imageFormat); + Response.End(); +} + +{% endhighlight %} +{% endtabs %} + +You can download a complete working sample from GitHub. + +By executing the program, you will get the **image** as follows. + +![PowerPoint to Image in ASP.NET MVC](PPTXtoPDF_images/Output_PowerPoint_Presentation_to-Image.png) + +Click [here](https://www.syncfusion.com/document-processing/powerpoint-framework/net) to explore the rich set of Syncfusion PowerPoint Library (Presentation) features. + +An online sample link to [convert PowerPoint Presentation to image](https://ej2.syncfusion.com/aspnetmvc/PowerPoint/PPTXToImage#/material3) in ASP.NET MVC. \ No newline at end of file diff --git a/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-Net.md b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-Net.md new file mode 100644 index 000000000..74d6ec2f6 --- /dev/null +++ b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-ASP-Net.md @@ -0,0 +1,98 @@ +--- +title: Convert PowerPoint to Image in ASP.NET | Syncfusion +description: Convert PowerPoint to image in ASP.NET using .NET PowerPoint library (Presentation) without Microsoft PowerPoint or interop dependencies. +platform: file-formats +control: PowerPoint +documentation: UG +--- + +# Convert PowerPoint to Image in ASP.NET + +Syncfusion PowerPoint is a [.NET PowerPoint library](https://www.syncfusion.com/document-processing/powerpoint-framework/net) used to create, read, edit and **convert PowerPoint documents** programmatically without **Microsoft PowerPoint** or interop dependencies. Using this library, you can **convert a PowerPoint to image in ASP.NET**. + +## Steps to convert PowerPoint to Image programmatically + +Step 1: Create a new C# ASP.NET web application project. + +![Create ASP.NET Web project](Workingwith_Web/Project-Open-and-Save.png) + +Step 2: Select the **Empty** template to create the project. + +![Select Web Forms template](Workingwith_Web/Empty-Open-and-Save.png) + +Step 3: Install the [Syncfusion.PresentationRenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.PresentationRenderer.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). + +![Install Syncfusion.PresentationRenderer.Net.Core Nuget package](Azure_Images/App_Service_Linux/Nuget_Package_PowerPoint_Presentation_to_PDF.png) + +N> Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion license key in your application to use our components. + +Step 4: Include the following namespaces in **MainPage.aspx.cs**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Presentation; +using Syncfusion.PresentationRenderer; + +{% endhighlight %} +{% endtabs %} + +Step 5: Add a new button in the **MainPage.aspx** as shown below. + +{% tabs %} +{% highlight HTML %} + +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits="Convert_PowerPoint_Presentation_to_Image.WebForm1" %> + + + + + + + +
+
+ +
+
+ + + +{% endhighlight %} +{% endtabs %} + +Step 6: Include the below code snippets in **MainPage.aspx.cs** to **convert a PowerPoint to image in ASP.NET**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +string filePath = Server.MapPath("~/App_Data/Input.pptx"); +//Open the existing PowerPoint presentation. +using (IPresentation pptxDoc = Presentation.Open(filePath)) +{ + //Initialize the PresentationRenderer. + pptxDoc.PresentationRenderer = new PresentationRenderer(); + //Converts the first slide into image. + using (Stream stream = pptxDoc.Slides[0].ConvertToImage(ExportImageFormat.Jpeg)) + { + //Create the output image file stream. + using (FileStream fileStreamOutput = File.Create(Server.MapPath("~/PPTXtoImage.Jpeg"))) + { + //Copy the converted image stream into created output image stream. + stream.CopyTo(fileStreamOutput); + } + } +} + +{% endhighlight %} +{% endtabs %} + +You can download a complete working sample from GitHub. + +By executing the program, you will get the **image** as follows. + +![PowerPoint to Image in ASP.NET](PPTXtoPDF_images/Output_PowerPoint_Presentation_to-Image.png) + +Click [here](https://www.syncfusion.com/document-processing/powerpoint-framework/net) to explore the rich set of Syncfusion PowerPoint Library (Presentation) features. + +An online sample link to [convert PowerPoint Presentation to image](https://ej2.syncfusion.com/aspnetcore/PowerPoint/PPTXToImage#/material3) in ASP.NET Core. diff --git a/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Blazor.md b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Blazor.md new file mode 100644 index 000000000..f53211f4f --- /dev/null +++ b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Blazor.md @@ -0,0 +1,343 @@ +--- +title: Convert PowerPoint to Image in Blazor | Syncfusion +description: Convert PowerPoint to image in Blazor using .NET Core PowerPoint library (Presentation) without Microsoft PowerPoint or interop dependencies. +platform: file-formats +control: PowerPoint +documentation: UG +--- + +# Convert PowerPoint to Image in Blazor + +Syncfusion PowerPoint is a [.NET Core PowerPoint library](https://www.syncfusion.com/document-processing/powerpoint-framework/net-core) used to create, read, edit and convert PowerPoint documents programmatically without **Microsoft PowerPoint** or interop dependencies. Using this library, you can **convert a PowerPoint to image in Blazor**. + +## Server app + +Step 1: Create a new C# Blazor Server app project. Select Blazor App from the template and click the Next button. + +![Create ASP.NET Core Web application in Visual Studio for Blazor PowerPoint document ](Workingwith_Blazor/Create_project.png) + +Step 2: Now, the project configuration window will popup. Click Create button to create a new project with the required project name. + +![Create a project name for your new project](Azure_Images/App_Service_Linux/Configure-PowerPoint-Presentation-to-PDF.png) + +Step 3: Choose **Blazor Server App** and click Create button to create a new Blazor Server app for .NET Core 3.0.0-preview9. + +![Select .NET Core, ASP.NET Core 3.0 and Blazor server_side.](Workingwith_Blazor/Core_application_Server.png) + +Step 4: Install the [Syncfusion.PresentationRenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.PresentationRenderer.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). + +![Install Syncfusion.PresentationRenderer.Net.Core Nuget Package](Azure_Images/App_Service_Linux/Nuget_Package_PowerPoint_Presentation_to_PDF.png) + +N> Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion license key in your application to use our components. + +Step 5: Create a razor file with name as **Presentation** under **Pages** folder and include the following namespaces in the file. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +@page "/presentation" +@using System.IO; +@using Convert_PowerPoint_Presentation_to_Image; +@inject Convert_PowerPoint_Presentation_to_Image.Data.PresentationService service +@inject Microsoft.JSInterop.IJSRuntime JS + +{% endhighlight %} +{% endtabs %} + +Step 6: Add the following code to create a new button. + +{% tabs %} +{% highlight CSHTML %} + +

Syncfusion PowerPoint (Presentation) library

+

Syncfusion PowerPoint (Presentation) library is used to create, read, edit, and convert PowerPoint files in your applications without Microsoft Office dependencies.

+ + +{% endhighlight %} +{% endtabs %} + +Step 7: Add the following code in **Presentation.razor** file to **convert PowerPoint to image** and download the **image file**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +@code { + MemoryStream documentStream; + /// + /// Download the image file. + /// + protected async void ConvertPPTXtoImage() + { + documentStream = service.ConvertPPTXtoImage(); + await JS.SaveAs("PPTXtoImage.Jpeg", documentStream.ToArray()); + } +} + +{% endhighlight %} +{% endtabs %} + +Step 8: Create a new cs file with name as **PowerPointService** under Data folder and include the following namespaces in the file. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Presentation; +using Syncfusion.PresentationRenderer; + +{% endhighlight %} +{% endtabs %} + +Step 9: Create a new MemoryStream method with name as **ConvertPPTXtoImage** in **PowerPointService** class and include the following code snippet to **convert a PowerPoint to image in Blazor Server app**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +//Open the file as Stream. +using (FileStream sourceStreamPath = new FileStream(@"wwwroot/Input.pptx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) +{ + //Open the existing PowerPoint presentation with loaded stream. + using (IPresentation pptxDoc = Presentation.Open(sourceStreamPath)) + { + //Initialize the PresentationRenderer to perform image conversion. + pptxDoc.PresentationRenderer = new PresentationRenderer(); + //Convert PowerPoint slide to image as stream. + using (Stream stream = pptxDoc.Slides[0].ConvertToImage(ExportImageFormat.Jpeg)) + { + //Save the converted image file to MemoryStream. + MemoryStream Stream = new MemoryStream(); + stream.CopyTo(Stream); + Stream.Position = 0; + //Download image file in the browser. + return Stream; + } + } +} + +{% endhighlight %} +{% endtabs %} + +Step 10: Create a new class file in the project, with name as FileUtils and add the following code to invoke the JavaScript action to download the file in the browser. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +public static class FileUtils +{ + public static ValueTask SaveAs(this IJSRuntime js, string filename, byte[] data) + => js.InvokeAsync( + "saveAsFile", + filename, + Convert.ToBase64String(data)); +} + +{% endhighlight %} +{% endtabs %} + +Step 11: Add the following JavaScript function in the **_Host.cshtml** in the Pages folder. + +{% tabs %} +{% highlight HTML %} + + + +{% endhighlight %} +{% endtabs %} + +You can download a complete working sample from GitHub. + +By executing the program, you will get the **image** as follows. + +![PowerPoint to Image in Blazor server app](PPTXtoPDF_images/Output_PowerPoint_Presentation_to-Image.png) + +Click [here](https://www.syncfusion.com/document-processing/powerpoint-framework/blazor) to explore the rich set of Syncfusion PowerPoint Library (Presentation) features. + +An online sample link to [convert PowerPoint Presentation to image](https://blazor.syncfusion.com/demos/powerpoint/pptx-to-image?theme=fluent) in Blazor. + +## WASM app + +Step 1: Create a new C# Blazor WASM app project. Select Blazor App from the template and click the Next button. + +![Create ASP.NET Core Web application in Visual Studio for Blazor PowerPoint document](Workingwith_Blazor/Create_project.png) + +Step 2: Now, the project configuration window will popup. Click Create button to create a new project with the required project name. + +![Create a project name for your new project](Workingwith_Blazor/Configure_project.png) + +Step 3: Choose Blazor WebAssembly App and click Create button to create a new Blazor WASM app for .NET Core 3.0.0-preview9. + +![Select .NET Core, ASP.NET Core 3.0 and Blazor server_side.](Workingwith_Blazor/Core_application_Client.png) + +Step 4: Install the following **Nuget packages** in your application from [Nuget.org](https://www.nuget.org/). + +* [Syncfusion.PresentationRenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.PresentationRenderer.Net.Core) +* [SkiaSharp.NativeAssets.WebAssembly v2.88.6](https://www.nuget.org/packages/SkiaSharp.NativeAssets.WebAssembly/2.88.6) + +![Install Syncfusion.PresentationRenderer.Net.Core Nuget Package](Azure_Images/App_Service_Linux/Nuget_Package_PowerPoint_Presentation_to_PDF.png) + +![Install SkiaSharp.NativeAssets.WebAssembly v2.88.6 Nuget Package](Workingwith_Blazor/Nuget-Package-PPTXtoPDF.png) + +N> Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion license key in your application to use our components. + +Step 5: Add the following ItemGroup tag in the **Blazor WASM csproj** file. + +{% tabs %} +{% highlight XAML %} + + + + + +{% endhighlight %} +{% endtabs %} + +N> Install this wasm-tools and wasm-tools-net6 by using the "dotnet workload install wasm-tools" and "dotnet workload install wasm-tools-net6" commands in your command prompt respectively if you are facing issues related to Skiasharp during runtime. + +Step 6: Enable the following property in the **Blazor WASM csproj** file. + +{% tabs %} +{% highlight XAML %} + + + true + + +{% endhighlight %} +{% endtabs %} + +Step 7: Create a razor file with name as ``Presentation`` under ``Pages`` folder and add the following namespaces in the file. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +@page "/presentation" +@inject Microsoft.JSInterop.IJSRuntime JS +@inject HttpClient client +@using System.IO +@using Syncfusion.Presentation +@using Syncfusion.PresentationRenderer + +{% endhighlight %} +{% endtabs %} + +Step 8: Add the following code to create a new button. + +{% tabs %} +{% highlight CSHTML %} + +

Syncfusion PowerPoint library (Essential Presentation)

+

Syncfusion Blazor PowerPoint library (Essential Presentation) used to create, read, edit, and convert PowerPoint files in your applications without Microsoft Office dependencies.

+ + +{% endhighlight %} +{% endtabs %} + +Step 9: Create a new async method with name as ``PPTXToImage`` and include the following code snippet to **convert a PowerPoint to image in Blazor WASM app**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +//Input data file is inside the wwwroot folder. +using (Stream inputStream = await client.GetStreamAsync("sample-data/Input.pptx")) +{ + //Open an existing PowerPoint Presentation file. + using (IPresentation pptxDoc = Syncfusion.Presentation.Presentation.Open(inputStream)) + { + //Initialize the PresentationRenderer to perform image conversion. + pptxDoc.PresentationRenderer = new PresentationRenderer(); + //Convert the entire Presentation to images. + Stream[] imageStreams = pptxDoc.RenderAsImages(ExportImageFormat.Jpeg); + for (int i = 0; i < imageStreams.Length; i++) + { + imageStreams[i].Position = 0; + //Download image file in the browser. + await JS.SaveAs("PPTXToImage_" + i + ".jpeg", (imageStreams[i] as MemoryStream).ToArray()); + } + } +} + +{% endhighlight %} +{% endtabs %} + +Step 10: To download the PowerPoint document in browser, create a class file with FileUtils name and add the following code to invoke the JavaScript action to download the file in the browser. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +public static class FileUtils +{ + public static ValueTask SaveAs(this IJSRuntime js, string filename, byte[] data) + => js.InvokeAsync( + "saveAsFile", + filename, + Convert.ToBase64String(data)); +} + +{% endhighlight %} +{% endtabs %} + +Step 11: Add the following JavaScript function in the **Index.html** file present under ``wwwroot``. + +{% tabs %} +{% highlight HTML %} + + + +{% endhighlight %} +{% endtabs %} + +You can download a complete working sample from GitHub. + +By executing the program, you will get the **image** as follows. + +![PowerPoint to Image in Blazor WASM app](PPTXtoPDF_images/Output_PowerPoint_Presentation_to-Image.png) + +N> Even though PowerPoint library works in WASM app, it is recommended to use server deployment. Since the WASM app deployment increases the application payload size. You can also explore our [Blazor PowerPoint library demo](https://blazor.syncfusion.com/demos/powerpoint/getting-started) that shows how to create and modify PowerPoint files from C# with just five lines of code. + +Click [here](https://www.syncfusion.com/document-processing/powerpoint-framework/blazor) to explore the rich set of Syncfusion PowerPoint Library (Presentation) features. + +An online sample link to [convert PowerPoint Presentation to image](https://blazor.syncfusion.com/demos/powerpoint/pptx-to-image?theme=fluent) in Blazor. diff --git a/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Linux.md b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Linux.md new file mode 100644 index 000000000..4f72e3db3 --- /dev/null +++ b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Linux.md @@ -0,0 +1,120 @@ +--- +title: Convert PowerPoint to Image in Linux | Syncfusion +description: Convert PowerPoint to image in Linux using .NET Core PowerPoint library (Presentation) without Microsoft PowerPoint or interop dependencies. +platform: file-formats +control: PowerPoint +documentation: UG +--- + +# Convert PowerPoint to Image in Linux + +Syncfusion PowerPoint is a [.NET Core PowerPoint library](https://www.syncfusion.com/document-processing/powerpoint-framework/net-core) used to create, read, edit and **convert PowerPoint documents** programmatically without **Microsoft PowerPoint** or interop dependencies. Using this library, you can **convert a PowerPoint to image in .NET Core application on Linux**. + +## Steps to convert PowerPoint to Image in .NET Core application on Linux + +Step 1: Execute the following command in **Linux terminal** to create a new .NET Core Console application. + +{% tabs %} +{% highlight KCONFIG %} + +dotnet new console + +{% endhighlight %} +{% endtabs %} + +![Create .NET Core console application on Linux](Workingwith_Linux/CreateCore.png) + +Step 2: Install the following **Nuget packages** in your application from [Nuget.org](https://www.nuget.org/) by execute the following command. + +* [Syncfusion.PresentationRenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.PresentationRenderer.Net.Core) +* [SkiaSharp.NativeAssets.Linux v2.88.2](https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux/2.88.2) +* [HarfBuzzSharp.NativeAssets.Linux v2.8.2.2](https://www.nuget.org/packages/HarfBuzzSharp.NativeAssets.Linux/2.8.2.2) + +{% tabs %} +{% highlight KCONFIG %} + +dotnet add package Syncfusion.PresentationRenderer.Net.Core -v 22.1.38 -s https://www.nuget.org/ +dotnet add package SkiaSharp.NativeAssets.Linux -v 2.88.2 -s https://www.nuget.org/ +dotnet add package HarfBuzzSharp.NativeAssets.Linux -v 2.8.2.2 -s https://www.nuget.org/ + +{% endhighlight %} +{% endtabs %} + +N> Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion license key in your applications to use our components. + +Step 3: Add the following Namespaces in **Program.cs** file. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Presentation; +using Syncfusion.PresentationRenderer; + +{% endhighlight %} +{% endtabs %} + +Step 4: Add the following code snippet in **Program.cs** file. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + + //Open the file as Stream. + using (FileStream fileStreamInput = new FileStream("Data/Input.pptx", FileMode.Open, FileAccess.Read)) + { + //Open the existing PowerPoint presentation with loaded stream. + using (IPresentation pptxDoc = Presentation.Open(fileStreamInput)) + { + //Initialize the PresentationRenderer to perform image conversion. + pptxDoc.PresentationRenderer = new PresentationRenderer(); + //Convert PowerPoint slide to image as stream. + using (Stream stream = pptxDoc.Slides[0].ConvertToImage(ExportImageFormat.Jpeg)) + { + //Reset the stream position. + stream.Position = 0; + //Create FileStream to save the image file. + using (FileStream outputStream = new FileStream("PPTXtoImage.Jpeg", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite)) + { + //Save the image file. + stream.CopyTo(outputStream); + } + } + } + } + +{% endhighlight %} +{% endtabs %} + +Step 5: Execute the following command to **restore** the NuGet packages. + +{% tabs %} +{% highlight KCONFIG %} + +dotnet restore + +{% endhighlight %} +{% endtabs %} + +![Restore the NuGet packages](Workingwith_Linux/Restore.png) + +Step 6: Execute the following command in **terminal** to **run the application**. + +{% tabs %} +{% highlight KCONFIG %} + +dotnet run + +{% endhighlight %} +{% endtabs %} + +![Run the Applcation](Workingwith_Linux/Run.png) + +You can download a complete working sample from GitHub. + +By executing the program, you will get the **image** as follows. The output will be saved in **bin** foleder. + +![PowerPoint to Image in Linux](PPTXtoPDF_images/Output_PowerPoint_Presentation_to-Image.png) + +Click [here](https://www.syncfusion.com/document-processing/powerpoint-framework/net-core) to explore the rich set of Syncfusion PowerPoint Library (Presentation) features. + +An online sample link to [convert PowerPoint Presentation to image](https://ej2.syncfusion.com/aspnetcore/PowerPoint/PPTXToImage#/material3) in ASP.NET Core. + diff --git a/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-MAUI.md b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-MAUI.md new file mode 100644 index 000000000..4adccab7e --- /dev/null +++ b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-MAUI.md @@ -0,0 +1,179 @@ +--- +title: Convert PowerPoint to Image in .NET MAUI | Syncfusion +description: Convert PowerPoint to image in .NET MAUI using .NET MAUI PowerPoint library (Presentation) without Microsoft PowerPoint or interop dependencies. +platform: file-formats +control: PowerPoint +documentation: UG +--- + +# Convert PowerPoint to Image in .NET MAUI + +Syncfusion PowerPoint is a [.NET MAUI PowerPoint library](https://www.syncfusion.com/powerpoint-framework/maui/powerpoint-library) used to create, read, edit and convert PowerPoint documents programmatically without **Microsoft PowerPoint** or interop dependencies. Using this library, you can **convert a PowerPoint to image in .NET MAUI**. + +## Prerequisites +To create .NET Multi-platform App UI (.NET MAUI) apps, you need the latest versions of Visual Studio 2022 and .NET 6. For more details, refer [here](https://docs.microsoft.com/en-us/dotnet/maui/get-started/installation). + +## Steps to convert PowerPoint to Image programmatically + +Step 1: Create a new C# .NET MAUI app. Select **.NET MAUI App (Preview)** from the template and click the **Next** button. + +![Create the MAUI app in Visual Studio](Workingwith_MAUI/Create_Project.png) + +Step 2: Enter the project name and click **Create**. + +![Create a project name for your new project](Workingwith_MAUI/Configuration_PPTXtoPDF.png) + +Step 3: Install the [Syncfusion.PresentationRenderer.NET](https://www.nuget.org/packages/Syncfusion.PresentationRenderer.NET) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/). + +![Install Syncfusion.PresentationRenderer.NET NuGet package](Workingwith_MAUI/Nuget_Package_PPTXtoPDF.png) + +N> Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion license key in your application to use our components. + +Step 4: Add a new button to the **MainPage.xaml** as shown below. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + + + + + + + + + + +{% endhighlight %} +{% endtabs %} + +Step 4: Include the following namespaces in the **MainWindow.xaml.cs** file. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Presentation; + +{% endhighlight %} +{% endtabs %} + +Step 5: Add the following code in **btnConvert_Click** to **convert PowerPoint to image in WPF**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +//Open a PowerPoint Presentation. +using (IPresentation pptxDoc = Presentation.Open("Data/Input.pptx")) +{ + //Converts the first slide into image. + System.Drawing.Image image = pptxDoc.Slides[0].ConvertToImage(Syncfusion.Drawing.ImageType.Metafile); + //Save the image as jpeg. + image.Save("PPTXtoImage.Jpeg"); +} + +{% endhighlight %} +{% endtabs %} + +You can download a complete working sample from GitHub. + +By executing the program, you will get the **image** as follows. + +![PowerPoint to Image in WPF](PPTXtoPDF_images/Output_PowerPoint_Presentation_to-Image.png) + +Click [here](https://www.syncfusion.com/document-processing/powerpoint-framework/net) to explore the rich set of Syncfusion PowerPoint Library (Presentation) features. + +An online sample link to [convert PowerPoint Presentation to image](https://ej2.syncfusion.com/aspnetcore/PowerPoint/PPTXToImage#/material3) in ASP.NET Core. \ No newline at end of file diff --git a/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-WinUI.md b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-WinUI.md new file mode 100644 index 000000000..c2adb928e --- /dev/null +++ b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-WinUI.md @@ -0,0 +1,163 @@ +--- +title: Convert PowerPoint to Image in WinUI | Syncfusion +description: Convert PowerPoint to image in WinUI using WinUI PowerPoint library (Presentation) without Microsoft PowerPoint or interop dependencies. +platform: file-formats +control: PowerPoint +documentation: UG +--- + +# Convert PowerPoint to Image in WinUI + +Syncfusion PowerPoint is a [WinUI PowerPoint library](https://www.syncfusion.com/document-processing/powerpoint-framework/winui/powerpoint-library) used to create, read, edit and convert PowerPoint documents programmatically without **Microsoft PowerPoint** or interop dependencies. Using this library, you can **convert a PowerPoint to image in WinUI**. + +## Prerequisites +To use the WinUI 3 project templates, install the Windows App SDK extension for Visual Studio. For more details, refer [here](https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/set-up-your-development-environment?tabs=cs-vs-community%2Ccpp-vs-community%2Cvs-2022-17-1-a%2Cvs-2022-17-1-b). + +## WinUI Desktop app + +Step 1: Create a new C# WinUI Desktop app. Select Blank App, Packaged with WAP (WinUI 3 in Desktop) from the template and click the **Next** button. + +![Create the WinUI Desktop app in Visual Studio](Workingwith_WinUI/Create-Project-WinUI-PPTXtoPDF.png) + +Step 2: Enter the project name and click **Create**. + +![Create a project name for your new project](Workingwith_WinUI/Configuration_PPTXtoPDF.png) + +Step 3: Install the [Syncfusion.PresentationRenderer.NET](https://www.nuget.org/packages/Syncfusion.Presentation.NET) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/). + +![Install Syncfusion.PresentationRenderer.NET NuGet package](Workingwith_MAUI/Nuget_Package_PPTXtoPDF.png) + +N> Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering a Syncfusion license key in your application to use our components. + +Step 4: Add a new button to the **MainWindow.xaml** as shown below. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + + + + + + + + + +{% endhighlight %} +{% endtabs %} + +Step 5: Include the following namespaces in the **MainWindow.xaml.cs** file. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Presentation; +using Syncfusion.PresentationRenderer; + +{% endhighlight %} +{% endtabs %} + +Step 6: Add a new action method **ConvertPPTXtoImage** in MainWindow.xaml.cs and include the below code snippet to **convert a PowerPoint to image in WinUI**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +//Loading an existing PowerPoint document. +Assembly assembly = typeof(App).GetTypeInfo().Assembly; +//Open the existing PowerPoint presentation with loaded stream. +using (IPresentation pptxDoc = Presentation.Open(assembly.GetManifestResourceStream("Convert_PowerPoint_Presentation_to_Image.Assets.Input.pptx"))) +{ + //Initialize the PresentationRenderer. + pptxDoc.PresentationRenderer = new PresentationRenderer(); + //Converts the first slide into image. + Stream stream = pptxDoc.Slides[0].ConvertToImage(ExportImageFormat.Jpeg); + //Reset the stream position. + stream.Position = 0; + //Save the stream as a image file in the local machine. + SaveHelper.SaveAndLaunch("PPTXtoImage.Jpeg", stream as MemoryStream); +} + +{% endhighlight %} +{% endtabs %} + +## Save Image file in WinUI + +{% tabs %} + +{% highlight c# tabtitle="C#" %} + +public static async void SaveAndLaunch(string filename, MemoryStream stream) +{ + StorageFile storageFile; + string extension = Path.GetExtension(filename); + //Gets process windows handle to open the dialog in application process. + IntPtr windowHandle = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle; + if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) + { + FileSavePicker savePicker = new(); + + if (extension == ".Jpeg") + { + savePicker.DefaultFileExtension = ".jpeg"; + savePicker.SuggestedFileName = filename; + //Saves the file as image file. + savePicker.FileTypeChoices.Add("JPEG", new List() { ".jpeg" }); + } + + WinRT.Interop.InitializeWithWindow.Initialize(savePicker, windowHandle); + storageFile = await savePicker.PickSaveFileAsync(); + } + else + { + StorageFolder local = ApplicationData.Current.LocalFolder; + storageFile = await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting); + } + if (storageFile != null) + { + using (IRandomAccessStream zipStream await storageFile.OpenAsync(FileAccessMode.ReadWrite)) + { + //Writes compressed data from memory to file. + using Stream outstream = zipStream.AsStreamForWrite(); + outstream.SetLength(0); + byte[] buffer = stream.ToArray(); + outstream.Write(buffer, 0, buffer.Length); + outstream.Flush(); + } + + //Creates message dialog box. + MessageDialog msgDialog = new("Do you want to view the Document?", "File has been converted successfully"); + UICommand yesCmd = new("Yes"); + msgDialog.Commands.Add(yesCmd); + UICommand noCmd = new("No"); + msgDialog.Commands.Add(noCmd); + + WinRT.Interop.InitializeWithWindow.Initialize(msgDialog, windowHandle); + + //Showing a dialog box. + IUICommand cmd = await msgDialog.ShowAsync(); + if (cmd.Label == yesCmd.Label) + { + //Launch the saved file. + await Windows.System.Launcher.LaunchFileAsync(storageFile); + } + } +} + +{% endhighlight %} +{% endtabs %} + +You can download a complete working sample from GitHub. + +By executing the program, you will get the **image** as follows. + +![PowerPoint to Image in WinUI Desktop](PPTXtoPDF_images/Output_PowerPoint_Presentation_to-Image.png) + +Click [here](https://www.syncfusion.com/document-processing/powerpoint-framework/winui) to explore the rich set of Syncfusion PowerPoint Library (Presentation) features. + +An online sample link to [convert PowerPoint Presentation to image](https://ej2.syncfusion.com/aspnetcore/PowerPoint/PPTXToImage#/material3) in ASP.NET Core. \ No newline at end of file diff --git a/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Windows-Forms.md b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Windows-Forms.md new file mode 100644 index 000000000..95caefe8c --- /dev/null +++ b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Windows-Forms.md @@ -0,0 +1,93 @@ +--- +title: Convert PowerPoint to Image in Windows Forms | Syncfusion +description: Convert PowerPoint to image in Windows Forms using .NET PowerPoint library (Presentation) without Microsoft PowerPoint or interop dependencies. +platform: file-formats +control: PowerPoint +documentation: UG +--- + +# Convert PowerPoint to Image in Windows Forms + +Syncfusion PowerPoint is a [.NET PowerPoint library](https://www.syncfusion.com/document-processing/powerpoint-framework/net) used to create, read, edit and convert PowerPoint documents programmatically without **Microsoft PowerPoint** or interop dependencies. Using this library, you can **convert a PowerPoint to image in Windows Forms**. + +## Steps to convert PowerPoint to Image programmatically + +Step 1: Create a new C# Windows Forms application project. + +![Create Windows Forms project](Workingwith_Windows/Project-Open-and-Save.png) + +Step 2: Install the [Syncfusion.Presentation.WinForms](https://www.nuget.org/packages/Syncfusion.Presentation.WinForms) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). + +![Install Syncfusion.Presentation.WinForms Nuget Package](Workingwith_Windows/Nuget-Package-PPTXtoImage.png) + +N> Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion license key in your application to use our components. + +Step 3: Include the following namespaces in the **Form1.cs** file. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Presentation; + +{% endhighlight %} +{% endtabs %} + +Step 4: Add a new button in **Form1.Designer.cs** file. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +private Button btnCreate; +private Label label; +private void InitializeComponent() +{ + label = new Label(); + btnCreate = new Button(); + //Label + label.Location = new System.Drawing.Point(0, 40); + label.Size = new System.Drawing.Size(426, 35); + label.Text = "Click the button to Convert PowerPoint to Image."; + label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + + //Button + btnCreate.Location = new System.Drawing.Point(180, 110); + btnCreate.Size = new System.Drawing.Size(85, 36); + btnCreate.Text = "Convert"; + btnCreate.Click += new EventHandler(btnConvert_Click); + + //Create PowerPoint + ClientSize = new System.Drawing.Size(450, 150); + Controls.Add(label); + Controls.Add(btnCreate); + Text = "Convert PowerPoint to Image"; +} + +{% endhighlight %} +{% endtabs %} + +Step 5: Add the following code in **btnConvert_Click** to **convert a PowerPoint to image in Windows Forms**. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +//Open an existing PowerPoint Presentation. +using (IPresentation pptxDoc = Presentation.Open("Data/Input.pptx")) +{ + //Convert the first slide into image. + Image image = pptxDoc.Slides[0].ConvertToImage(Syncfusion.Drawing.ImageType.Metafile); + //Save the image file. + image.Save("PPTXtoImage.Jpeg"); +} + +{% endhighlight %} +{% endtabs %} + +You can download a complete working sample from GitHub. + +By executing the program, you will get the **Image** as follows. + +![PowerPoint to Image in Windows Forms](PPTXtoPDF_images/Output_PowerPoint_Presentation_to-Image.png) + +Click [here](https://www.syncfusion.com/document-processing/powerpoint-framework/net) to explore the rich set of Syncfusion PowerPoint Library (Presentation) features. + +An online sample link to [convert PowerPoint Presentation to image](https://ej2.syncfusion.com/aspnetcore/PowerPoint/PPTXToImage#/material3) in ASP.NET Core. \ No newline at end of file diff --git a/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Xamarin.md b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Xamarin.md new file mode 100644 index 000000000..d807fa87a --- /dev/null +++ b/File-Formats/Presentation/Convert-PowerPoint-Presentation-to-Image-in-Xamarin.md @@ -0,0 +1,182 @@ +--- +title: Convert PowerPoint to Image in Xamarin | Syncfusion +description: Convert PowerPoint to image in Xamarin using Xamarin PowerPoint library (Presentation) without Microsoft PowerPoint or interop dependencies. +platform: file-formats +control: PowerPoint +documentation: UG +--- + +# Convert PowerPoint to Image in Xamarin + +Syncfusion PowerPoint is a [Xamarin PowerPoint library](https://www.syncfusion.com/document-processing/powerpoint-framework/xamarin/powerpoint-library) used to create, read, edit and convert PowerPoint documents programmatically without **Microsoft PowerPoint** or interop dependencies. Using this library, you can **convert a PowerPoint to image in Xamarin**. + +## Steps to convert PowerPoint to Image programmatically + +Step 1: Create a new C# **Xamarin.Forms** application project. + +![Create Xamarin project](Workingwith_Xamarin/Project-Open-and-Save.png) + +Step 2: Select a project template and required platforms to deploy the application. In this application the portable assemblies to be shared across multiple platforms, the .NET Standard code sharing strategy has been selected. For more details about code sharing refer [here](https://docs.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/code-sharing). + +![Create Xamarin CodeSharing Option](Workingwith_Xamarin/Template-Project-Open-and-Save.png) + +Step 3: Install [Syncfusion.Xamarin.PresentationRenderer](https://www.nuget.org/packages/Syncfusion.Xamarin.PresentationRenderer) NuGet package as a reference to the .NET Standard project in your Xamarin applications from [NuGet.org](https://www.nuget.org/). + +![Install Syncfusion.Xamarin.PresentationRenderer Nuget Package](Workingwith_Xamarin/Nuget-Packge-PPTXtoPDF.png) + +N> Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion license key in your application to use our components. + +Step 4: Add new Forms XAML page in portable project If there is no XAML page is defined in the App class. Otherwise proceed to the next step. +
    +
  • To add the new XAML page, right click on the project and select Add > New Item and add a Forms XAML Page from the list. Name it as MainXamlPage.
  • +
  • In App class of portable project (App.cs), replace the existing constructor of App class with the code snippet given below which invokes the MainXamlPage.
  • +
+ +{% tabs %} +{% highlight c# tabtitle="C#" %} + +public App() +{ + // The root page of your application + MainPage = new MainXamlPage(); +} + +{% endhighlight %} +{% endtabs %} + +Step 5: In the **MainXamlPage.xaml** add new button as shown below. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + + + + +