A
A
Alisher Taubaldy2021-07-29 08:40:56
C++ / C#
Alisher Taubaldy, 2021-07-29 08:40:56

How can I generate a PDF document in Russian using C#?

I want to create a PDF document from scratch and sign it using IText7 libraries. I was able to sign, but I cannot generate a document in Cyrillic.

String SRC = @"C:\\download\\demo.pdf";

                PdfWriter writer = new PdfWriter(SRC);
                PdfDocument pdf = new PdfDocument(writer);
                Document document = new Document(pdf);

                Paragraph header = new Paragraph("Текст для примера Example text")
                .SetTextAlignment(TextAlignment.RIGHT)
                .SetFontSize(10);

                Paragraph subheader = new Paragraph(textBox1.Text)
                .SetTextAlignment(TextAlignment.CENTER)
                .SetFontSize(15);

                document.Add(subheader);
                document.Add(header);
                document.Close();

61023f48e3ab1407359752.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
s7on1250, 2021-07-29
@FlamelMamel

Most likely you need to adjust the font to Cyrillic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question