This article provides a complete step-by-step guide to how to create an ASP.NET PDF generator application in .NET Core. So let’s create a professional ASP.NET PDF editor and easily edit and format the PDFs with a user-friendly interface.
Creating PDF files programmatically is quite useful for generating documents such as reports, resumes, invoices, etc. online within web applications. So let’s proceed to create PDF files in ASP.NET Core with C#.
ASP.NET PDF Editor: Create PDF Files in ASP.NET
To create PDF files programmatically, we’ll develop a PDF editor in an ASP.NET Core web application. This application will be based on a WYSIWYG HTML editor to create the content and Aspose.PDF for .NET to generate the PDF based on that content. So let’s begin creating our PDF editor application in ASP.NET Core by following the below steps.
- Create a new ASP.NET Core Web Application in Visual Studio.
- Select Web Application (Model-View-Controller) from the templates.
Since this PDF editor uses the WYSIWYG HTML editor to create the content for PDF documents, for the demonstration, I have used CKEditor’s Standard Package. You can feel free to choose your favorite HTML editor that could best serve your requirements. If you are good to go with the afore-mentioned editor then follow the below step for its integration, else skip it.
- Download the CKEditor’s package, extract it and copy/paste the folder in wwwroot directory.
- Open NuGet Package Manager and install the packages of Aspose.PDF and CKEditor.
- Open Views/Home/index.cshtml and replace the script with the following.
- Open Controllers/HomeController.cs and replace the code with the following.
- Build the application and run it in your favorite browser.
Creating PDF in ASP.NET Core Application
The following is a demonstration of how to create PDF files using ASP.NET Core PDF generator we have just created.
Download ASP.NET PDF Editor
You can download the complete source code of the ASP.NET PDF Editor from GitHub.
Free .NET PDF Editor Library
You can get a free temporary license of Aspose.PDF for .NET and use it without limitations.
In this article, you have learned how to create a PDF editor application in ASP.NET Core. You have seen how easily you can create and format PDF files using this application. Download the source code and let us know in case you need to know more about Aspose.PDF.