diff --git a/Document-Processing/Excel/Conversions/Excel-to-Image/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img10.png b/Document-Processing/Excel/Conversions/Excel-to-Image/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img10.png deleted file mode 100644 index ef41c7241e..0000000000 Binary files a/Document-Processing/Excel/Conversions/Excel-to-Image/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img10.png and /dev/null differ diff --git a/Document-Processing/Excel/Conversions/Excel-to-Image/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img11.png b/Document-Processing/Excel/Conversions/Excel-to-Image/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img11.png deleted file mode 100644 index cf0da1ad61..0000000000 Binary files a/Document-Processing/Excel/Conversions/Excel-to-Image/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img11.png and /dev/null differ diff --git a/Document-Processing/Excel/Conversions/Excel-to-Image/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img9.png b/Document-Processing/Excel/Conversions/Excel-to-Image/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img9.png index 606cadc6e3..81c5cf82cb 100644 Binary files a/Document-Processing/Excel/Conversions/Excel-to-Image/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img9.png and b/Document-Processing/Excel/Conversions/Excel-to-Image/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img9.png differ diff --git a/Document-Processing/Excel/Conversions/Excel-to-Image/NET/convert-excel-to-image-in-ASP-NET-MVC.md b/Document-Processing/Excel/Conversions/Excel-to-Image/NET/convert-excel-to-image-in-ASP-NET-MVC.md index b30d2a20ab..45a962cf22 100644 --- a/Document-Processing/Excel/Conversions/Excel-to-Image/NET/convert-excel-to-image-in-ASP-NET-MVC.md +++ b/Document-Processing/Excel/Conversions/Excel-to-Image/NET/convert-excel-to-image-in-ASP-NET-MVC.md @@ -16,21 +16,13 @@ Step 1: Create a new ASP.NET Web Application Project. ![Create a ASP.NET Web App project in visual studio](ASP-NET-MVC_images\ASP-NET-MVC_images_img9.png) -Step 2: Name the project, choose the framework and click **Create** button. - -![Name the project and choose the framework version](ASP-NET-MVC_images\ASP-NET-MVC_images_img10.png) - -Step 3: Select the MVC application. - -![Select the MVC App](ASP-NET-MVC_images\ASP-NET-MVC_images_img11.png) - -Step 4: Install the [Syncfusion.XlsIO.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.XlsIO.AspNet.Mvc5) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/). +Step 2: Install the [Syncfusion.XlsIO.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.XlsIO.AspNet.Mvc5) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/). ![Install Syncfusion.XlsIO.AspNet.Mvc5 NuGet Package](ASP-NET-MVC_images\ASP-NET-MVC_images_img12.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 applications to use our components. -Step 5: Add a new button in the **Index.cshtml** as shown below. +Step 3: Add a new button in the **Index.cshtml** as shown below. {% tabs %} {% highlight CSHTML %} @{Html.BeginForm("ConvertExceltoImage", "Home", FormMethod.Get); @@ -44,14 +36,14 @@ Step 5: Add a new button in the **Index.cshtml** as shown below. {% endhighlight %} {% endtabs %} -Step 6: Include the following namespaces in **HomeController.cs**. +Step 4: Include the following namespaces in **HomeController.cs**. {% tabs %} {% highlight c# tabtitle="C#" %} using Syncfusion.XlsIO; {% endhighlight %} {% endtabs %} -Step 7: Include the below code snippet in **HomeController.cs** to **convert an Excel document to Image**. +Step 5: Include the below code snippet in **HomeController.cs** to **convert an Excel document to Image**. {% tabs %} {% highlight c# tabtitle="C#" %} public void ConvertExcelToImage() diff --git a/Document-Processing/Excel/Conversions/Excel-to-Image/NET/convert-excel-to-image-in-WPF.md b/Document-Processing/Excel/Conversions/Excel-to-Image/NET/convert-excel-to-image-in-WPF.md index 9fccb15202..8ce4df8201 100644 --- a/Document-Processing/Excel/Conversions/Excel-to-Image/NET/convert-excel-to-image-in-WPF.md +++ b/Document-Processing/Excel/Conversions/Excel-to-Image/NET/convert-excel-to-image-in-WPF.md @@ -62,18 +62,21 @@ using Syncfusion.XlsIO; Step 6: Include the below code snippet in **btnConvert_Click** to **convert an Excel document to Image**. {% tabs %} {% highlight c# tabtitle="C#" %} -using (ExcelEngine excelEngine = new ExcelEngine()) +private void btnConvert_Click(object sender, EventArgs e) { - IApplication application = excelEngine.Excel; - application.DefaultVersion = ExcelVersion.Xlsx; - IWorkbook workbook = application.Workbooks.Open("Sample.xlsx"); - IWorksheet worksheet = workbook.Worksheets[0]; - - //Convert the Excel to image - System.Drawing.Image image = worksheet.ConvertToImage(1, 1, 20, 4); - - //Save the image as jpeg - image.Save("Sample.Jpeg", ImageFormat.Jpeg); + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + IWorkbook workbook = application.Workbooks.Open("Sample.xlsx"); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Convert the Excel to image + System.Drawing.Image image = worksheet.ConvertToImage(1, 1, 20, 4); + + //Save the image as jpeg + image.Save("Sample.Jpeg", ImageFormat.Jpeg); + } } {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img4.png b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img4.png index cd4944ddb1..4d656d4692 100644 Binary files a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img4.png and b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img4.png differ diff --git a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img5.png b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img5.png deleted file mode 100644 index 2c758da7ff..0000000000 Binary files a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img5.png and /dev/null differ diff --git a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img6.png b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img6.png deleted file mode 100644 index b6224e3f3f..0000000000 Binary files a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/ASP-NET-MVC_images/ASP-NET-MVC_images_img6.png and /dev/null differ diff --git a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/Blazor_images/Blazor_images_Server_App.png b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/Blazor_images/Blazor_images_Server_App.png index dc080c7d7c..cc07ec753f 100644 Binary files a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/Blazor_images/Blazor_images_Server_App.png and b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/Blazor_images/Blazor_images_Server_App.png differ diff --git a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/WinUI_images/WinUI_images_img6.png b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/WinUI_images/WinUI_images_img6.png index 57055fc233..abd0faace4 100644 Binary files a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/WinUI_images/WinUI_images_img6.png and b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/WinUI_images/WinUI_images_img6.png differ diff --git a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/convert-excel-to-pdf-in-asp-net-mvc.md b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/convert-excel-to-pdf-in-asp-net-mvc.md index c017f2f524..91fb04c7e4 100644 --- a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/convert-excel-to-pdf-in-asp-net-mvc.md +++ b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/convert-excel-to-pdf-in-asp-net-mvc.md @@ -16,21 +16,13 @@ Step 1: Create a new ASP.NET Web Application Project. ![Create a ASP.NET Web App project in visual studio](ASP-NET-MVC_images\ASP-NET-MVC_images_img4.png) -Step 2: Name the project, choose the framework and click **Create** button. - -![Name the project and choose the framework version](ASP-NET-MVC_images\ASP-NET-MVC_images_img5.png) - -Step 3: Select the MVC application. - -![Select the MVC App](ASP-NET-MVC_images\ASP-NET-MVC_images_img6.png) - -Step 4: Install the [Syncfusion.ExcelToPdfConverter.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.ExcelToPdfConverter.AspNet.Mvc5) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/). +Step 2: Install the [Syncfusion.ExcelToPdfConverter.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.ExcelToPdfConverter.AspNet.Mvc5) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/). ![Install Syncfusion.ExcelToPdfConverter.AspNet.Mvc5 NuGet Package](ASP-NET-MVC_images\ASP-NET-MVC_images_img7.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 applications to use our components. -Step 5: Add a new button in the **Index.cshtml** as shown below. +Step 3: Add a new button in the **Index.cshtml** as shown below. {% tabs %} {% highlight CSHTML %} @{Html.BeginForm("ConvertExceltoPDF", "Home", FormMethod.Get); @@ -44,7 +36,7 @@ Step 5: Add a new button in the **Index.cshtml** as shown below. {% endhighlight %} {% endtabs %} -Step 6: Include the following namespaces in **HomeController.cs**. +Step 4: Include the following namespaces in **HomeController.cs**. {% tabs %} {% highlight c# tabtitle="C#" %} using Syncfusion.XlsIO; @@ -53,7 +45,7 @@ using Syncfusion.ExcelToPdfConverter; {% endhighlight %} {% endtabs %} -Step 7: Include the below code snippet in **HomeController.cs** to **convert an Excel document to PDF**. +Step 5: Include the below code snippet in **HomeController.cs** to **convert an Excel document to PDF**. {% tabs %} {% highlight c# tabtitle="C#" %} using (ExcelEngine excelEngine = new ExcelEngine()) diff --git a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/convert-excel-to-pdf-in-blazor.md b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/convert-excel-to-pdf-in-blazor.md index e03a29da1c..0a922e9609 100644 --- a/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/convert-excel-to-pdf-in-blazor.md +++ b/Document-Processing/Excel/Conversions/Excel-to-PDF/NET/convert-excel-to-pdf-in-blazor.md @@ -20,21 +20,13 @@ Step 1: Create a new C# Blazor Server app project. ![Create a Blazor Server App project in visual studio](Blazor_images\Blazor_images_Server_App.png) -Step 2: Name the project. - -![Name the project](Blazor_images\Blazor_images_Server_App_ProjectName.png) - -Step 3: Select the framework and click **Create** button. - -![Framework version](Blazor_images\Blazor_images_Server_App_Framework.png) - -Step 4: Install the [Syncfusion.XlsIORenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIORenderer.Net.Core) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/). +Step 2: Install the [Syncfusion.XlsIORenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIORenderer.Net.Core) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/). ![Install Syncfusion.XlsIORenderer.Net.Core NuGet Package](Blazor_images\Blazor_images_Server_App_Nuget.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 applications to use our components -Step 5: Create a razor file with name as **XlsIO** under **Pages** folder and include the following namespaces in the file. +Step 3: Create a razor file with name as **XlsIO** under **Pages** folder and include the following namespaces in the file. {% tabs %} {% highlight c# tabtitle="C#" %} @page "/xlsio" @@ -44,7 +36,7 @@ Step 5: Create a razor file with name as **XlsIO** under **Pages** folder and in {% endhighlight %} {% endtabs %} -Step 6: Add the following code in **XlsIO.razor** file to create a new button. +Step 4: Add the following code in **XlsIO.razor** file to create a new button. {% tabs %} {% highlight CSHTML %}

Syncfusion XlsIO library

@@ -53,7 +45,7 @@ Step 6: Add the following code in **XlsIO.razor** file to create a new button. {% endhighlight %} {% endtabs %} -Step 7: Add the following code in **XlsIO.razor** file to create and download the **PDF document**. +Step 5: Add the following code in **XlsIO.razor** file to create and download the **PDF document**. {% tabs %} {% highlight c# tabtitle="C#" %} @code { @@ -70,7 +62,7 @@ Step 7: Add the following code in **XlsIO.razor** file to create and download th {% endhighlight %} {% endtabs %} -Step 8: Create a new cs file with name as **ExcelService** under Data folder and include the following namespaces in the file. +Step 6: Create a new cs file with name as **ExcelService** under Data folder and include the following namespaces in the file. {% tabs %} {% highlight c# tabtitle="C#" %} using Syncfusion.XlsIO; @@ -79,7 +71,7 @@ using Syncfusion.XlsIORenderer; {% endhighlight %} {% endtabs %} -Step 9: Create a new MemoryStream method with name as **ConvertExceltoPDF** in **ExcelService** class and include the following code snippet to **convert an Excel document to Pdf** in Server app. +Step 7: Create a new MemoryStream method with name as **ConvertExceltoPDF** in **ExcelService** class and include the following code snippet to **convert an Excel document to Pdf** in Server app. {% tabs %} {% highlight c# tabtitle="C#" %} using (ExcelEngine excelEngine = new ExcelEngine()) @@ -335,17 +327,9 @@ An online sample link to ® license key in your application to use our components. -Step 5: Add the following ItemGroup tag in the **Blazor WASM csproj** file. +Step 3: Add the following ItemGroup tag in the **Blazor WASM csproj** file. {% tabs %} {% highlight XAML %} @@ -365,7 +349,7 @@ Step 5: Add the following ItemGroup tag in the **Blazor WASM csproj** file. 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. +Step 4: Enable the following property in the Blazor WASM csproj file. {% tabs %} {% highlight XAML %} @@ -375,7 +359,7 @@ Step 6: Enable the following property in the Blazor WASM csproj file. {% endhighlight %} {% endtabs %} -Step 7: Create a razor file with name as **XlsIO** under **Pages** folder and include the following namespaces in the file. +Step 5: Create a razor file with name as **XlsIO** under **Pages** folder and include the following namespaces in the file. {% tabs %} {% highlight c# tabtitle="C#" %} @page "/xlsio" @@ -387,7 +371,7 @@ Step 7: Create a razor file with name as **XlsIO** under **Pages** folder and in {% endhighlight %} {% endtabs %} -Step 8: Add the following code to create a new button. +Step 6: Add the following code to create a new button. {% tabs %} {% highlight CSHTML %}

Syncfusion XlsIO library

@@ -396,41 +380,46 @@ Step 8: Add the following code to create a new button. {% endhighlight %} {% endtabs %} -Step 9: Create a new async method with name as **ExcelToPDF** and include the following code snippet to **create an Excel document in Blazor** WASM app. +Step 7: Create a new async method with name as **ExcelToPDF** and include the following code snippet to **create an Excel document in Blazor** WASM app. {% tabs %} {% highlight c# tabtitle="C#" %} -using (ExcelEngine excelEngine = new ExcelEngine()) -{ - IApplication application = excelEngine.Excel; - application.DefaultVersion = ExcelVersion.Xlsx; - - //Load an existing file - using (Stream inputStream = await client.GetStreamAsync("Data/InputTemplate.xlsx")) +@code { + async void ExcelToPDF() { - // Open the workbook. - IWorkbook workbook = application.Workbooks.Open(inputStream); + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; - // Instantiate the Excel to PDF renderer. - XlsIORenderer renderer = new XlsIORenderer(); + //Load an existing file + using (Stream inputStream = await client.GetStreamAsync("Data/InputTemplate.xlsx")) + { + // Open the workbook. + IWorkbook workbook = application.Workbooks.Open(inputStream); + + // Instantiate the Excel to PDF renderer. + XlsIORenderer renderer = new XlsIORenderer(); - //Convert Excel document into PDF document - PdfDocument pdfDocument = renderer.ConvertToPDF(workbook); + //Convert Excel document into PDF document + PdfDocument pdfDocument = renderer.ConvertToPDF(workbook); - //Create the MemoryStream to save the converted PDF. - MemoryStream pdfStream = new MemoryStream(); + //Create the MemoryStream to save the converted PDF. + MemoryStream pdfStream = new MemoryStream(); - //Save the converted PDF document to MemoryStream. - pdfDocument.Save(pdfStream); - pdfStream.Position = 0; + //Save the converted PDF document to MemoryStream. + pdfDocument.Save(pdfStream); + pdfStream.Position = 0; - //Download PDF file in the browser. - await JS.SaveAs("Output.pdf", pdfStream.ToArray()); + //Download PDF file in the browser. + await JS.SaveAs("Output.pdf", pdfStream.ToArray()); + } + } } } {% endhighlight %} {% endtabs %} -Step 10: Create a class file with **FileUtils** name and add the following code to invoke the JavaScript action to download the file in the browser. +Step 8: 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 @@ -444,7 +433,7 @@ public static class FileUtils {% endhighlight %} {% endtabs %} -Step 11: Add the following JavaScript function in the **Index.html** file present under **wwwroot**. +Step 9: Add the following JavaScript function in the **Index.html** file present under **wwwroot**. {% tabs %} {% highlight HTML %}