Create a C# application that connects to a PostgreSQL database, retrieves data from a table containing information about employees (name, job title, salary), and generates a report in PDF format using a third-party library like iTextSharp.
PLAINFORMAT
using Npgsql;
using iText.Kernel.Pdf;
using iText.Layout;
using iText.Layout.Element;
using System;
using System.Collections.Generic;

public class Employee
{
    public string Name { get; set; }
    public string JobTitle { get; set; }
    public decimal Salary { get; set; }
}

public class Program
{
    public static void Main(string[] args)
    {
        var app = new Program();

        // Retrieve employee data from the database
        var employees = app.GetEmployees();

        // Generate the PDF report
        string outputPath = "EmployeeReport.pdf";
        app.GeneratePdfReport(employees, outputPath);

        Console.WriteLine($"PDF report generated at {outputPath}");
    }

    public List<Employee> GetEmployees()
    {
        var employees = new List<Employee>();

        // Replace these values with your own connection details
        string connectionString = "Host=localhost;Username=myusername;Password=mypassword;Database=mydatabase";

        using (var connection = new NpgsqlConnection(connectionString))
        {
            connection.Open();

            using (var command = new NpgsqlCommand("SELECT name, job_title, salary FROM employees", connection))
            {
                using (var reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        employees.Add(new Employee
                        {
                            Name = reader.GetString(0),
                            JobTitle = reader.GetString(1),
                            Salary = reader.GetDecimal(2)
                        });
                    }
                }
            }
        }

        return employees;
    }

    public void GeneratePdfReport(List<Employee> employees, string outputPath)
    {
        using (var writer = new PdfWriter(outputPath))
        {
            using (var pdf = new PdfDocument(writer))
            {
                var document = new Document(pdf);

                // Add a title to the report
                document.Add(new Paragraph("Employee Report"));

                // Create a table with 3 columns for name, job title, and salary
                var table = new Table(3);
                table.AddHeaderCell("Name");
                table.AddHeaderCell("Job Title");
                table.AddHeaderCell("Salary");

                foreach (var employee in employees)
                {
                    table.AddCell(employee.Name);
                    table.AddCell(employee.JobTitle);
                    table.AddCell(employee.Salary.ToString());
                }

                document.Add(table);
                document.Close();
            }
        }
    }
}