hi while sting builder table data iTextSharp.text.pdf.PdfWriter convertion to pdf kannada language not converted pdf issue
Loading
hi while sting builder table data iTextSharp.text.pdf.PdfWriter convertion to pdf kannada language not converted pdf issue
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tahir AnsariRank #366 · 6.8K reputationPosted Aug 5, 2023, 7:18 AM EDT
string outputPath = "output.pdf"; // Create a new document Document document = new Document(); PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(outputPath, FileMode.Create)); // Open the document for writing document.Open(); // Use a font that supports Kannada characters BaseFont kannadaFont = BaseFont.CreateFont(@"path-to-kannada-font.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); // Create a font object with the Kannada font Font font = new Font(kannadaFont, 12); // Add Kannada text to the document string kannadaText = "????? ????"; document.Add(new Paragraph(new Chunk(kannadaText, font))); // Close the document document.Close(); Console.WriteLine("PDF created successfully.");Cr BhargaviRank #420 · 5.9K reputationPosted Aug 5, 2023, 7:22 AM EDT
Hi, Please ensure you are using a font that supports Kannada characters. You can check if the font you are using has the necessary glyphs for Kannada script and try embedding your kannada font like below
PdfPTable table = new PdfPTable(1); table.RunDirection = PdfWriter.RUN_DIRECTION_LTR; // Ensure text direction is set correctly table.DefaultCell.RunDirection = PdfWriter.RUN_DIRECTION_LTR; // Ensure cell text direction is set correctly table.DefaultCell.SetFont(kannadaFont); table.AddCell("Your kannada texts");