Exporting issues in PDF format
In addition to being able to view data inside a line of business app, often, it is desired to be able to be export data, for example, as a PDF, so that you can print it or send it via email. For this, we will write an interface that allows users to export a given issue to PDF. Since there are no built-in APIs for this, we will use the iText library for this. Note that if you want to use the library in your application, you either need to follow the AGPL license or buy a commercial license for the library. However, before we can write the code to generate the PDF, we will need to prepare the project:
- First, we need to install the iText NuGet package. For this, right-click the solution and search for iText. Select the package. Then, from the project list, select the macOS, UWP, and WASM heads and click Install.
- Now, create a class named
ExportIssueViewModel.cs
inside theViewModels
folder with the following code:using iText.Kernel.Pdf; using...