русский язык при использовании Itext7
Не отображается русский язык в файле Pdf, который был создан с помощью библиотеки Itext?
using iText.IO.Font.Constants;
using iText.Kernel.Font;
using iText.Kernel.Geom;
using iText.Kernel.Pdf;
using iText.Layout;
using iText.Layout.Element;
using iText.Layout.Properties;
var name = "pdf";
var path = $"D:\\{name}.pdf";
PdfWriter writer = new PdfWriter(path);
PdfDocument pdf = new PdfDocument(writer);
Document document = new Document(pdf, PageSize.A4);
document.SetMargins(20, 20, 20, 20);
var font = PdfFontFactory.CreateFont(StandardFonts.TIMES_ROMAN);
var bold = PdfFontFactory.CreateFont(StandardFonts.TIMES_BOLD);
Paragraph header = new Paragraph("Приложение к диплому А № 132123")
.SetTextAlignment(TextAlignment.RIGHT)
.SetFontSize(12);
document.Add(header);
document.Close();
при открытии файла есть только числа
Источник: Stack Overflow на русском