Как вывести таблицу на русском языке в pdf с помощью itext?

Я получаю данные из базы, закидываю в таблицу, но значения кириллицей не отображаются в файле pdf. Вот код:

private static void pdfs()
        throws Exception {
    try {
        Class.forName("com.mysql.cj.jdbc.Driver");
        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/kursovaya?serverTimezone=Europe/Moscow&useSSL=false", "root", "12345");
        Statement stmt = con.createStatement();
        ResultSet query_set = stmt.executeQuery("SELECT *FROM products");
        Document my_pdf_report = new Document();
        PdfWriter.getInstance(my_pdf_report, new FileOutputStream("C:\\Users\\hi\\Desktop\\example.pdf"));
        my_pdf_report.open();
        PdfPTable my_report_table = new PdfPTable(6);
        PdfPCell table_cell;

        addTableHeader(my_report_table);
        while (query_set.next()) {

            String code = query_set.getString("code");
            table_cell = new PdfPCell(new Phrase(code));
            my_report_table.addCell(table_cell);
            String name = query_set.getString("name");
            table_cell = new PdfPCell(new Phrase(name);
            my_report_table.addCell(table_cell);
            String price = query_set.getString("price");
            table_cell = new PdfPCell(new Phrase(price));
            my_report_table.addCell(table_cell);
            String size = query_set.getString("size");
            table_cell = new PdfPCell(new Phrase(size);
            my_report_table.addCell(table_cell);
            String descr = query_set.getString("description");
            table_cell = new PdfPCell(new Phrase(descr);
            my_report_table.addCell(table_cell);
            String amount = query_set.getString("amount");
            table_cell = new PdfPCell(new Phrase(amount);
            my_report_table.addCell(table_cell);
        }

        my_pdf_report.add(my_report_table);
        my_pdf_report.close();
        query_set.close();
        stmt.close();
        con.close();


    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (DocumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
public static void addTableHeader(PdfPTable table) {
    Stream.of("Артикул", "Наименование товара", "Цена товара", "Размер товара", "Описание товара", "Кол-во товара")
            .forEach(columnTitle -> {
                PdfPCell header = new PdfPCell();
                header.setBackgroundColor(BaseColor.LIGHT_GRAY);
                header.setBorderWidth(2);
                header.setPhrase(new Phrase(columnTitle));
                table.addCell(header);
            });
}

Ответы (0 шт):