1. Tag Results
windows (11)
1 - 11 of 11
How to Center Align Tabs in .NET MAUI Tab View?
This article guides you on how to center align tabs in .NET MAUI Tab View for Windows and Mac platforms. To customize the placement of tabs to the center of the Windows and Mac screens, set TabWidthMode to SizeToContent and adjust TabHeaderPadding dynamically based on the screen’s width. Below is a code snippet demonstrating this approach. XAML <tabView:SfTabView TabWidthMode="SizeToContent"> <!-- Tab View Content --> </tabView:SfTabView> C# public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); } protected override void OnAppearing() { base.OnAppearing(); #if WINDOWS var window = GetParentWindow().Handler.PlatformView as MauiWinUIWindow; if (window != null) { UpdateTabHeaderPadding(window.Bounds.Width); } #elif MACCATALYST var macWindow = GetParentWindow().Handler.PlatformView as UIWindow; if (macWindow != null) { UpdateTabHeaderPadding(macWindow.Bounds.Width); } #endif } #if WINDOWS || MACCATALYST protected override void OnSizeAllocated(double width, double height) { base.OnSizeAllocated(width, height); UpdateTabHeaderPadding(width); } private void UpdateTabHeaderPadding(double width) { double totalTabWidth = 0; foreach (var tabItem in tabView.Items) { if (tabItem is Syncfusion.Maui.TabView.SfTabItem tabItemView) { totalTabWidth += tabItemView.Measure(double.PositiveInfinity, double.PositiveInfinity).Request.Width; } } double remainingSpace = ((width - totalTabWidth)); double padding = (remainingSpace / 2) ; tabView.TabHeaderPadding = new Thickness(padding, 0, 0, 0); } #endif } The TabWidthMode is set to SizeToContent so that each tab’s width is adjusted based on its content. The method UpdateTabHeaderPadding calculates the total width of all the tab items and dynamically adjusts the left padding of the tab headers to center them based on the screen width. Output Download the complete sample from GitHub. Conclusion I hope you enjoyed learning how to center-align tabs in .NET MAUI Tab View. You can refer to our .NET MAUI Tab View feature tour page to learn about its other groundbreaking feature representations. Explore our documentation to understand how to present and manipulate data. For current customers, you can check out our components on the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our other controls. Please let us know in the comments section if you have any queries or require clarification. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!
How to create PDF in docker container in .NET Core ?
Syncfusion Essential® PDF is a .NET Core PDF library used to create, read, and edit PDF documents. Using this library, you can create a PDF document in docker using ASP.NET Core. Steps to create PDF in docker programmatically: Create a new C# ASP.NET Core web application project. Select the project template with Model-View-Controller and enable the docker support. Select the target OS (Windows or Linux) based on the requirement. In this article, Linux has been used as Target OS. Install the Syncfusion.Pdf.Net.Core NuGet package as reference to your .NET Core project from NuGet.org. Add a new button (Create Document) in the Index.cshtml as shown below. @{Html.BeginForm("CreateDocument", "Home", FormMethod.Get); { <div>      <input type="submit" value="Create Document" style="width:150px; height:27px" /> </div> } Html.EndForm(); } Include the following namespaces in the HomeController.cs file. C# using Syncfusion.Pdf; using Syncfusion.Pdf.Graphics; using Syncfusion.Drawing; using System.IO;   VB.NET Imports Syncfusion.Pdf Imports Syncfusion.Pdf.Graphics Imports Syncfusion.Drawing Imports System.IO   Add a new action method CreateDocument in HomeController.cs and include the following code snippet to create a PDF file and download it. C# //Create a new PDF document PdfDocument document = new PdfDocument();   //Add a page to the document PdfPage page = document.Pages.Add();   //Create PDF graphics for the page PdfGraphics graphics = page.Graphics;   //Set the standard font PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 20);   //Draw the text graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, new PointF(0, 0));   //Saving the PDF to the MemoryStream MemoryStream stream = new MemoryStream();   document.Save(stream);   //Set the position as '0' stream.Position = 0;   //Download the PDF document in the browser FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf");   fileStreamResult.FileDownloadName = "Sample.pdf";   return fileStreamResult;   VB.NET 'Create a new PDF document Dim document As PdfDocument = New PdfDocument   'Add a page to the document Dim page As PdfPage = document.Pages.Add   'Create PDF graphics for the page Dim graphics As PdfGraphics = page.Graphics   'Set the standard font Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 20)   'Draw the text graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, New PointF(0, 0))   'Saving the PDF to the MemoryStream Dim stream As MemoryStream = New MemoryStream   document.Save(stream)   'Set the position as '0' stream.Position = 0   'Download the PDF document in the browser Dim fileStreamResult As FileStreamResult = New FileStreamResult(stream, "application/pdf")   fileStreamResult.FileDownloadName = "Output.pdf"   Return fileStreamResult Build and run the sample in docker. It will pull the Linux docker image from the docker hub and run the project. It will prompt for accessing the windows drives. Now, the webpage will open in the browser. Click the Create PDF button to create a PDF document in Linux docker container. A complete working sample can be downloaded from CreatePdf_DockerSample.zip By executing the program, you will get the PDF document from docker as follows. Take a moment to peruse the documentation, where you will find other options like drawing right-to-left text and multi-column text, consuming TrueType fonts, Standard fonts, and CJK fonts. Also, the features like PDF form filling, extract text or images from PDF, and protect PDF documents with code examples.   Refer here to explore the rich set of Syncfusion Essential® PDF features. An online sample link to generate Hello world PDF document. See Also: Create a PDF file in Xamarin Create a PDF file in ASP.NET MVC Create a PDF file in WPF Create a PDF file in Windows Forms Note:Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, include a license key in your projects. Refer to link to learn about generating and registering Syncfusion® license key in your application to use the components without trail message.  ConclusionI hope you enjoyed learning about how to create PDF in docker container in .NET Core application.You can refer to our .NET PDF Core’s feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our PDF example to understand how to create and manipulate data in the .NET PDF. For current customers, you can check out our Document processing libraries from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our .NET Core PDF and other .NET Core controls.If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!
Converting HTML to PDF in a Windows Docker Container using ASP.NET Core
The Syncfusion® HTML to PDF converter for .NET Core is a powerful library for transforming webpages, SVG, MHTML, and HTML content into PDF documents. By employing the Linux HTML converter within a Windows Docker environment, developers can achieve reliable HTML to PDF conversions seamlessly. This guide provides a step-by-step approach to performing these conversions in a Windows Docker container.Prerequisites:      Docker for Windows: Download Docker for Windows from docker.com.       Switching Containers: Use the Docker for Windows menu to toggle between Windows and Linux containers as needed, selecting "Switch to Windows containers" for this specific guide.Steps to convert HTML to PDF in windows docker container programmatically:1.Create an ASP.NET Core MVC Application: Initiate a project using ASP.NET Core Model-View-Controller pattern. 2. Enable Docker support and select Windows as the target operating system. 3. Install Syncfusion Package: Add Syncfusion.HtmlToPdfConverter.Net.Windows from NuGet as a project reference.  Be aware that Microsoft’s ASP.NET Core Docker image on nanoserver is lightweight but lacks some Windows APIs; it supports 64-bit applications only, which might affect compatibility with certain wrappers. Add a new button in index.cshtml as follows.4. Add PDF Conversion Functionality: Insert the following element in index.cshtml.<h2>Click the button to generate PDF</h2> @using (Html.BeginForm("ExportToPDF", "Home", FormMethod.Post)) { <input type="submit" value="Export to PDF" /> }5. Implement the Conversion Logic in the Controller: Include the required namespaces:C#using Syncfusion.Pdf; using Syncfusion.HtmlConverter;6. Add the conversion code snippet in HomeController.cs.C#public IActionResult ExportToPDF() { // Initialize the HTML to PDF converter HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(); // Convert the specified URL to a PDF document PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com"); // Create a memory stream to hold the PDF data MemoryStream stream = new MemoryStream(); // Save the PDF document to the memory stream document.Save(stream); // Return the PDF file as a downloadable response return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "Sample.pdf"); }7.Build and Run the Application: Deploy the application in Docker, which will open the webpage in a browser. Use the "Export to PDF" button to perform the conversion. Take a moment to peruse the documentation for converting HTML to PDF, where you will find other options like HTML string to PDF, partial webpage to PDF, HTML to single PDF page, and HTML to PDF conversion using IE Rendering with code examples.A complete work sample can be downloaded from HTMLToPDF_WindowsDocker.zipConclusionI hope you enjoyed learning about how to convert HTML to PDF in windows docker container in ASP.NET Core PDF.You can refer to our ASP.NET Core PDF feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET Core PDF example to understand how to create and manipulate data.For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.  
How to add Flutter Maps on the web and desktop platforms?
We have provided web support for the Syncfusion® Flutter Maps package. You can run the following commands in the IDE terminal one by one to configure the web support.   flutter channel betaflutter upgrade flutter config --enable-webflutter create . flutter run -d chrome   You need to make sure you have Chrome or any other browsers on your machine along with Flutter SDK to run the application on the web platform. The supported web browsers for Flutter app are mentioned here.   @override Widget build(BuildContext context) {    return Scaffold(       body: SfMaps(         layers: [           MapTileLayer(             urlTemplate:'https://tile.openstreetmap.org/{z}/{x}/{y}.png',           ),        ],     ),  ); }   We have also enabled support for Windows, macOS and Linux platforms for our maps package. Follow these steps to run maps in macOS, Windows and Linux platforms.   Live samples for web, https://flutter.syncfusion.com/#/maps/shape-layer/range-color-mapping Package reference, https://pub.dev/packages/syncfusion_flutter_maps  
How to create WinForms PDF in Windows Docker using C#?
The Syncfusion Essential PDF is a .NET Core PDF library used to create, read, and edit PDF documents. Using this library, you can create a PDF document in the ASP.NET Core platform in Windows docker. Steps to create a PDF document in Windows Docker using C#: Create a new ASP.NET Core application and enable the docker support with Windows as a target OS. Install the Syncfusion.Pdf.Net.Core NuGet package as a reference to your .NET Core project from NuGet.org. Add a new button (Create Document) in the Index.cshtml as follows. <div class="btn"> @{ Html.BeginForm("CreatePDF", "Home", FormMethod.Post); {                 <input type="submit" value="Create PDF" class=" btn" /> }} </div>   Include the following namespaces in the HomeController.cs file.using Syncfusion.Pdf; using Syncfusion.Pdf.Graphics; using Syncfusion.Drawing; using System.IO;   Add a new action method CreateDocument in HomeController.cs and include the following code sample to create a PDF file and download it.   //Create a new PDF document PdfDocument document = new PdfDocument(); //Add a page to the document PdfPage page = document.Pages.Add(); //Create PDF graphics for the page PdfGraphics graphics = page.Graphics;  //Set the standard font PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 20);  //Draw the text graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, new PointF(0, 0));  //Saving the PDF to the MemoryStream MemoryStream stream = new MemoryStream(); document.Save(stream);  //Set the position to '0' stream.Position = 0;  //Download the PDF document in the browser FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf");  fileStreamResult.FileDownloadName = "Sample.pdf";  return fileStreamResult; Build and run the sample in the docker, it will pull the Windows docker image from the docker hub and run the project. Now, the webpage will open in the browser. Click the Create PDF button to create the PDF document from the Windows docker. By executing the program, you will get the PDF document as follows. A complete work sample for creating a PDF in the Windows docker container can be downloaded from CreatePdfDocker_Windows.zip. Take a moment to peruse the documentation. You will find other options like drawing right-to-left text and multi-column text, consuming TrueType fonts, Standard fonts, and CJK fonts. Also, the features like PDF form filling, extract text, or images from PDF, and protect PDF documents with code examples.   Click here to explore the rich set of Syncfusion Essential PDF features.   See Also: Create a PDF file in Xamarin Create a PDF file in ASP.NET MVC Create a PDF file in WPF Create a PDF file in Windows Forms   Note:Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or the NuGet feed, include a license key in your projects. Refer to the link to learn about generating and registering the Syncfusion® license key in your application to use the components without a trial message. Conclusion:I hope you enjoyed learning about how to create WinForms PDF in Windows Docker using C#. You can refer to our Flutter PDF feature tour page to learn about its other groundbreaking features and documentation, and how to quickly get started with configuration specifications. You can also explore our Flutter PDF Flutter PDF examples to understand how to create and manipulate data.For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to explore our other controls.If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums or feedback portal. We are always happy to assist you!
How do I change the color of the LineConnector in WinForms Diagram?
How do I change the color of the LineConnector when activating the line tool? You can change the color of the LineConnector while activating the LineTool. You have to customize the LineTool and LineBase class. In the MouseUp event of the LineTool class, you can change the color of the link. Please refer to the following code snippet in CustomLineConnector class. public override Tool ProcessMouseUp(MouseEventArgs evtArgs){    CompleteAction(ptStart, ptEnd);}private void CompleteAction(PointF ptStart, PointF ptEnd){    Node node = CreateNode(ptStart, ptEnd);    node.LineStyle.LineColor = Color.Red;}// To activate the LineTool in MainForm.csMyLineTool linetool = new MyLineTool(this.diagram1.Controller);this.diagram1.Controller.RegisterTool(linetool);this.diagram1.Controller.ActivateTool(linetool);Public Overrides Function ProcessMouseUp(ByVal evtArgs As MouseEventArgs) As Tool    CompleteAction(ptStart, ptEnd)End FunctionPrivate Sub CompleteAction(ByVal ptStart As PointF, ByVal ptEnd As PointF)    Dim node As Node = CreateNode(ptStart, ptEnd)    node.LineStyle.LineColor = Color.RedEnd Sub ''''To activate the LineTool in MainForm.cs Dim linetool As MyLineTool = New MyLineTool(Me.diagram1.Controller) Me.diagram1.Controller.RegisterTool(linetool) Me.diagram1.Controller.ActivateTool(linetool) ConclusionI hope you enjoyed learning about how do I change the color of the LineConnector in WinForms Diagram.You can refer to our WinForms Diagram feature tour page to learn about its other groundbreaking feature representations. You can also explore our documentation to understand how to create and manipulate data.For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!
How to create PDF in docker container?
Syncfusion Essential® PDF is a .NET Core PDF library used to create, read, and edit PDF documents. Using this library, you can create a PDF document in docker using ASP.NET Core. Steps to create PDF in docker programmatically: Create a new C# ASP.NET Core web application project. Select the project template with Model-View-Controller and enable the docker support. Select the target OS (Windows or Linux) based on the requirement. In this article, Linux has been used as Target OS. Install the Syncfusion.Pdf.Net.Core NuGet package as reference to your .NET Core project from NuGet.org. Add a new button (Create Document) in the Index.cshtml as shown below. @{Html.BeginForm("CreateDocument", "Home", FormMethod.Get); { <div>      <input type="submit" value="Create Document" style="width:150px; height:27px" /> </div> } Html.EndForm(); } Include the following namespaces in the HomeController.cs file. C# using Syncfusion.Pdf; using Syncfusion.Pdf.Graphics; using Syncfusion.Drawing; using System.IO;   VB.NET Imports Syncfusion.Pdf Imports Syncfusion.Pdf.Graphics Imports Syncfusion.Drawing Imports System.IO   Add a new action method CreateDocument in HomeController.cs and include the following code snippet to create a PDF file and download it. C# //Create a new PDF document PdfDocument document = new PdfDocument();   //Add a page to the document PdfPage page = document.Pages.Add();   //Create PDF graphics for the page PdfGraphics graphics = page.Graphics;   //Set the standard font PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 20);   //Draw the text graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, new PointF(0, 0));   //Saving the PDF to the MemoryStream MemoryStream stream = new MemoryStream();   document.Save(stream);   //Set the position as '0' stream.Position = 0;   //Download the PDF document in the browser FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf");   fileStreamResult.FileDownloadName = "Sample.pdf";   return fileStreamResult;   VB.NET 'Create a new PDF document Dim document As PdfDocument = New PdfDocument   'Add a page to the document Dim page As PdfPage = document.Pages.Add   'Create PDF graphics for the page Dim graphics As PdfGraphics = page.Graphics   'Set the standard font Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 20)   'Draw the text graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, New PointF(0, 0))   'Saving the PDF to the MemoryStream Dim stream As MemoryStream = New MemoryStream   document.Save(stream)   'Set the position as '0' stream.Position = 0   'Download the PDF document in the browser Dim fileStreamResult As FileStreamResult = New FileStreamResult(stream, "application/pdf")   fileStreamResult.FileDownloadName = "Output.pdf"   Return fileStreamResult Build and run the sample in docker. It will pull the Linux docker image from the docker hub and run the project. It will prompt for accessing the windows drives. Now, the webpage will open in the browser. Click the Create PDF button to create a PDF document in Linux docker container. A complete working sample can be downloaded from CreatePdf_DockerSample.zip By executing the program, you will get the PDF document from docker as follows. Take a moment to peruse the documentation, where you will find other options like drawing right-to-left text and multi-column text, consuming TrueType fonts, Standard fonts, and CJK fonts. Also, the features like PDF form filling, extract text or images from PDF, and protect PDF documents with code examples.   Refer here to explore the rich set of Syncfusion Essential® PDF features. An online sample link to generate Hello world PDF document.ConclusionI hope you enjoyed learning about how to create PDF in docker window.You can refer to our ASP.NET Core PowerPoint's feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our PowerPoint example to understand how to create and manipulate data.For current customers, you can check out our Document processing libraries from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out other controls.If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you! See Also: Create a PDF file in Xamarin Create a PDF file in ASP.NET MVC Create a PDF file in WPF Create a PDF file in Windows Forms Note:Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or the NuGet feed, include a license key in your projects. Refer to the link to learn about generating and registering the Syncfusion® license key in your application to use the components without a trial message.A new version of Essential Studio® for ASP.NET is available. Versions prior to the release of Essential Studio® 2014, Volume 2 will now be referred to as classic versions. The new ASP.NET suite is powered by Essential Studio for JavaScript, providing client-side rendering of HTML5-JavaScript controls, offering better performance, and better support for touch interactivity. The new version includes all the features of the old version, so migration is easy.The Classic controls can be used in existing projects; however, if you are starting a new project, we recommend using the latest version of Essential Studio® for ASP.NET. Although Syncfusion® will continue to support all Classic Versions, we are happy to assist you in migrating to the newest edition.For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below.You can also contact us through our support forums or feedback portal. We are always happy to assist you!  
How to create Word document in WinForms DocIO?
Syncfusion® Essential® DocIO is a .NET Word library used to create, read, and edit Word documents programmatically without Microsoft Word or interop dependencies. Using this library, you can create a Word document in Windows Forms. Steps to create a Word document programmatically: Create a new Windows Forms application project. Install the Syncfusion.DocIO.WinForms NuGet package as a reference to your Windows Forms application from NuGet.org. Include the following namespaces in the Form1.Designer.cs file. C# using Syncfusion.DocIO.DLS; using System; using System.ComponentModel; using System.Windows.Forms; VB Imports Syncfusion.DocIO.DLS Imports System.ComponentModel Imports System.Windows.Forms Add a new button in Form1.Designer.cs to create a Word file as follows. 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 view a Word document generated by Essential DocIO. Please note that Microsoft Word Viewer or Microsoft Word is required to view the resultant Word document";     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 = "Create Document";     btnCreate.Click += new EventHandler(btnCreate_Click);       // Create Word     ClientSize = new System.Drawing.Size(450, 150);     Controls.Add(label);     Controls.Add(btnCreate);     Text = "Create Word"; } VB Private label As Label Private WithEvents btnCreate As Button   Private Sub InitializeComponent()    label = New Label    btnCreate = New Button      'Label    label.Location = New Drawing.Point(0, 40)    label.Size = New Drawing.Size(426, 35)    label.Text = ("Click the button to view a Word document generated by Essential DocIO. Please note that Microsoft Word Viewer or Microsoft Word is required to view the resultant Word document")    label.TextAlign = Drawing.ContentAlignment.MiddleCenter      'Button    btnCreate.Location = New Drawing.Point(180, 110)    btnCreate.Size = New Drawing.Size(85, 36)    btnCreate.Text = "Create Document"    AddHandler btnCreate.Click, AddressOf Me.btnCreate_Click      'Create Spreadsheet    ClientSize = New Drawing.Size(450, 150)    Controls.Add(label)    Controls.Add(btnCreate)    Text = "Create Word" End Sub Add the following code in btnCreate_Click to create a Word document with simple text. C# // Creates a new instance of WordDocument (Empty Word Document) using (WordDocument document = new WordDocument()) {     // Adds a section and a paragraph to the document     document.EnsureMinimal();     // Appends text to the last paragraph of the document     document.LastParagraph.AppendText("Hello World");     // Saves the Word document     document.Save("Result.docx"); } VB ' Creates a new instance of WordDocument (Empty Word Document) Using document As WordDocument = New WordDocument     ' Adds a section and a paragraph to the document     document.EnsureMinimal()     ' Appends text to the last paragraph of the document     document.LastParagraph.AppendText("Hello World")     ' Saves the Word document     document.Save("Result.docx") End Using A complete working example of how to create a Word document in Windows Forms can be downloaded from Create-Word-file.zip By executing the program, you will get the Word document as follows. Take a moment to peruse the documentation, where you can find basic Word document processing options along with features like mail merge, merge and split documents, find and replace text in the Word document, protect the Word documents, and most importantly, PDF and image conversions with code examples. Explore more about the rich set of Syncfusion® Word Framework features. An online example to generate or create Word document. See Also: Create a Word document in WPF Create a Word document in ASP.NET Core Create a Word document in ASP.NET MVC Create a Word document in Xamarin Create a Word document in Xamarin.Android Note:Starting with v16.2.0.x, if you reference Syncfusion® assemblies from a trial setup or from the NuGet feed, include a license key in your projects. Refer to the link to learn about generating and registering the Syncfusion® license key in your application to use the components without a trial message.   Conclusion I hope you enjoyed learning about how to create a Word document in Windows Forms. You can refer to our WinForms DocIO’s feature tour page to know about its other groundbreaking features. You can also explore our documentation to understand how to present and manipulate data. For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other components. If you have any queries or require clarifications, please let us know in the comments below. You can also contact us through our support forums or feedback portal. We are always happy to assist you!
How to create an Excel file in Windows Forms
Syncfusion Essential&reg; XlsIO is a .NET Excel library used to create, read, and edit Excel documents. Using this library, you can create an Excel document in Windows Forms.   Steps to create an Excel file programmatically:   Create a new Windows Forms application project.     Install the Syncfusion.XlsIO.WinForms NuGet package as a reference to your .NET Framework applications from the NuGet.org.     Include the following namespaces in the Form1.Designer.cs file.   using Syncfusion.XlsIO; using System; using System.ComponentModel; using System.Windows.Forms;   Imports Syncfusion.XlsIO Imports System.ComponentModel Imports System.Windows.Forms   Add a new button in Form1.Designer.cs to create Excel file as follows.   private Button btnCreate; private Label label;   private void InitializeComponent() {   btnCreate = new Button();   label = new Label();     // Label   label.Location = new System.Drawing.Point(0, 40);   label.Size = new System.Drawing.Size(426, 35);   label.Text = "Click the button to view an Excel spreadsheet generated by Essential XlsIO. Please note that MS Excel Viewer or MS Excel is required to view the resultant document.";   label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;     // Button   btnCreate.Location = new System.Drawing.Point(180, 110);   btnCreate.Size = new System.Drawing.Size(85, 26);   btnCreate.Text = "Create Document";   btnCreate.Click += new EventHandler(btnCreate_Click);       // Create Spreadsheet   ClientSize = new System.Drawing.Size(450, 150);   Controls.Add(label);   Controls.Add(btnCreate);   Text = "Create Spreadsheet"; }   Private label As Label Private WithEvents btnCreate As Button   Private Sub InitializeComponent()   label = New Label()   btnCreate = New Button()     'Label   label.Location = New Drawing.Point(0, 40)   label.Size = New Drawing.Size(426, 35)   label.Text = "Click the button to view an Excel spreadsheet generated by Essential XlsIO. Please note that MS Excel Viewer or MS Excel is required to view the resultant document."   label.TextAlign = Drawing.ContentAlignment.MiddleCenter     'Button   btnCreate.Location = New Drawing.Point(180, 110)   btnCreate.Size = New Drawing.Size(85, 26)   btnCreate.Text = "Create Document"     'Create Spreadsheet   ClientSize = New Drawing.Size(450, 150)   Controls.Add(btnCreate)   Controls.Add(label)   Text = "Create Spreadsheet" End Sub   Add the following code in btnCreate_Click to create Excel file with simple text.   // Create an instance of ExcelEngine using (ExcelEngine excelEngine = new ExcelEngine()) {   // Set the default application version as Excel 2016   excelEngine.Excel.DefaultVersion = ExcelVersion.Excel2016;     // Create a workbook with a worksheet   IWorkbook workbook = excelEngine.Excel.Workbooks.Create(1);     // Access the first worksheet from the workbook instance   IWorksheet worksheet = workbook.Worksheets[0];     // Insert sample text into cell “A1”   worksheet.Range["A1"].Text = "Hello World";     // Save the workbook to disk in xlsx format   workbook.SaveAs("Output.xlsx"); }   'Create an instance of ExcelEngine Using excelEngine As ExcelEngine = New ExcelEngine     'Set the default application version as Excel 2016   excelEngine.Excel.DefaultVersion = ExcelVersion.Excel2016     'Create a workbook with a worksheet   Dim workbook As IWorkbook = excelEngine.Excel.Workbooks.Create(1)     'Access first worksheet from the workbook instance   Dim worksheet As IWorksheet = workbook.Worksheets(0)     'Insert sample text into cell “A1”   worksheet.Range("A1").Text = "Hello World"     'Save the workbook to disk in xlsx format   workbook.SaveAs("Output.xlsx")   End Using   A complete working example of how to create Excel file in Windows Forms can be downloaded from Create-Excel-file.zip   By executing the program, you will get the Excel file as follows.     Take a moment to peruse the documentation, where you can find basic worksheet data manipulation options along with features like Conditional Formatting, worksheet calculations through Formulas, adding Charts in worksheet or workbook, organizing and analyzing data through Tables and Pivot Tables, appending multiple records to worksheet using Template Markers, and most importantly PDF and Image conversions with code examples.   Refer here to explore the rich set of Syncfusion Essential&reg; XlsIO features.   An online sample link to generate Excel file.   See Also: Create an Excel file in WPF Create an Excel file in ASP.NET Core Create an Excel file in ASP.NET MVC Create an Excel file in Xamarin   Note:Starting with v16.2.0.x, if you reference Syncfusion&reg; assemblies from a trial setup or from the NuGet feed, include a license key in your projects. Refer to the link to learn about generating and registering the Syncfusion&reg; license key in your application to use the components without a trial message. ConclusionI hope you enjoyed learning about How to create an Excel file in Windows Forms.You can refer to our XIsIO’s feature tour page to learn about its other groundbreaking features. Explore our UG documentation and online demos to understand how to manipulate data in Excel documents.If you are an existing user, you can access our latest components from the License and Downloads page. For new users, you can try our 30-day free trial to check out XlsIO and other Syncfusion&reg; components.If you have any queries or require clarification, please let us know in the comments below or contact us through our support forums, Support Tickets, or feedback portal. We are always happy to assist you!
How to create a PDF file in Windows Forms?
PDF (Portable Document Format) is a file format used to display the document with same formatting, independent of application software, hardware, and operating system. Syncfusion Essential PDF is a .NET PDF library used to create, read, and edit PDF documents. Using this library, you can create a PDF document in Windows Forms. Steps to create PDF programmatically: Create a new Windows Forms application project. Install the Syncfusion.Pdf.WinForms NuGet package as a reference to your  .NET Framework applications from NuGet.org. Include the following namespaces in the Form1.Designer.cs file. C# using Syncfusion.Pdf; using Syncfusion.Pdf.Graphics; using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms;   VB.NET Imports Syncfusion.Pdf Imports Syncfusion.Pdf.Graphics Imports System Imports System.ComponentModel Imports System.Drawing Imports System.Windows.Forms   Add a new button in Form1.Designer.cs to create PDF document as follows. C# private Button btnCreate; private Label label;   private void InitializeComponent() {   btnCreate = new Button();   label = new Label();     //Label   label.Location = new System.Drawing.Point(0, 40);   label.Size = new System.Drawing.Size(426, 35);   label.Text = "Click the button to view PDF file generated by Essential PDF";   label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;     //Button   btnCreate.Location = new System.Drawing.Point(180, 110);   btnCreate.Size = new System.Drawing.Size(85, 26);   btnCreate.Text = "Create PDF";   btnCreate.Click += new EventHandler(btnCreate_Click);       //Create PDF   ClientSize = new System.Drawing.Size(450, 150);   Controls.Add(label);   Controls.Add(btnCreate);   Text = "Create PDF"; }   VB.NET Private label As Label Private WithEvents btnCreate As Button   Private Sub InitializeComponent()   label = New Label()   btnCreate = New Button()     'Label   label.Location = New Drawing.Point(0, 40)   label.Size = New Drawing.Size(426, 35)   label.Text = "Click the button to view PDF file generated by Essential PDF"   label.TextAlign = Drawing.ContentAlignment.MiddleCenter     'Button   btnCreate.Location = New Drawing.Point(180, 110)   btnCreate.Size = New Drawing.Size(85, 26)   btnCreate.Text = "Create PDF"     'Create PDF   ClientSize = New Drawing.Size(450, 150)   Controls.Add(btnCreate)   Controls.Add(label)   Text = "Create PDF" End Sub   Add the following code in btnCreate_Click to create a PDF file with simple text. C# //Create a new PDF document using (PdfDocument document = new PdfDocument()) {   //Add a page to the document   PdfPage page = document.Pages.Add();     //Create PDF graphics for a page   PdfGraphics graphics = page.Graphics;     //Set the standard font   PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 20);     //Draw the text   graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, new PointF(0, 0));     //Save the document   document.Save("Output.pdf"); }   VB.NET 'Create a new PDF document Using document As PdfDocument = New PdfDocument()     'Add a page to the document   Dim page As PdfPage = document.Pages.Add()     'Create PDF graphics for a page   Dim graphics As PdfGraphics = page.Graphics     'Set the standard font   Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 20)     'Draw the text   graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, New PointF(0, 0))     'Save the document   document.Save("Output.pdf")   End Using   A complete working sample can be downloaded from Create-PDF-file.zip By executing the program, you will get the PDF document as follows. Take a moment to peruse the documentation, where you will find other options like drawing right-to-left text and multi-column text, consuming TrueType fonts, Standards fonts, CJK fonts. Also, the features like PDF form filling, extract text or images from PDF, protect PDF documents with code examples. Refer here to explore the rich set of Syncfusion Essential PDF features. An online sample link to generate Hello world PDF document. See Also: Create a PDF file in Xamarin Create a PDF file in ASP.NET Core Create a PDF file in ASP.NET MVC Create a PDF file in WPF Note:Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, include a license key in your projects. Refer to link to learn about generating and registering Syncfusion license key in your application to use the components without trail message.  
How to use Pdfium rendering engine in Syncfusion PDF viewer for exporting the PDF documents into images
From 16.1.0.24 and higher versions of Essential Studio release, the PDF viewer control provides a robust rendering of PDF document using Pdfium rendering engine. You can use Pdfium rendering to Export the PDF documents to images in the ASP.NET platform using the  Syncfusion.PdfViewer.Windows reference. The steps to use Pdfium rendering are as follows: 1. Copy the Pdfium assembly’s folder to a local folder from the installation path. The folder name must be “Pdfium”.  The Pdfium assemblies will be available in {$SystemDrive}:\Program Files (x86)\Syncfusion\Essential Studio\{Essential Studio version}\Pdfium   The Pdfium folder contains two folders namely X86 and X64, and both contains pdfium.dll assembly for the respective architecture. The Syncfusion PDF viewer is designed to detect the architecture of the target machine in which it is deployed and pick corresponding pdfium.dll to use it. 2. Then, the ReferencePath property of the PDF viewer should be set to locate the “Pdfium” folder.The following code snippet illustrates how to export the PDF document into images using the PDFium. string mappath = HttpContext.Current.Server.MapPath("~/Data/Sample.pdf"); PdfViewerControl viewer = new PdfViewerControl(); //Set the reference path of Pdfium assemblies            viewer.ReferencePath = "D:/"; //Set the rendering engine of PDF viewer to Pdfium viewer.RenderingEngine = PdfRenderingEngine.Pdfium; //Load the PDF document viewer.Load(mappath); string imagePath = HttpContext.Current.Server.MapPath("~/Images/"); Bitmap[] img = viewer.ExportAsImage(0, viewer.PageCount - 1); for (int i = 0; i < img.Length; i++) {     img[i].Save(imagePath + "\\Image" + i + ".png"); }   Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/PdfViewerWeb_pdfium1045004189 Here is the User Guide documentation of Syncfusion PDF Viewer in ASP.NET Web Forms. Refer to this link to explore a rich set of PDF Viewer features.
No articles found
No articles found
1 of 1 pages (11 items)