0

グジャラート語の HTML テキストを PDF にレンダリングしようとしましたが、レンダリングされますが正しくありません。「કાર્બન કેમેસ્ટ્રી」テキストを PDF にレンダリングしようとしましたが、「કારબન કેમસટર​​ી」のようにレンダリングされます。

適切にレンダリングするのを手伝ってください。

  protected void btnPDF_Click(object sender, EventArgs e)
    {
        Document doc = new Document(iTextSharp.text.PageSize.LETTER, 10, 10, 42, 35);

        BaseFont Gujarati = iTextSharp.text.pdf.BaseFont.CreateFont("C:\\WINDOWS\\Fonts\\ARIALUNI.TTF", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); // --> CHANGED

        iTextSharp.text.Font fontNormal = new iTextSharp.text.Font(Gujarati);

        PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream("c:\\Test11.pdf", FileMode.Create));
        //Open Document to write
        doc.Open();

        //Write some content
        Paragraph paragraph = new Paragraph("કાર્બન કેમેસ્ટ્રી", fontNormal); // --->> CHANGED Specify the font to use

        // Now add the above created text using different class object to our pdf document
        doc.Add(paragraph);

        doc.Close(); //Close document
    }
4

0 に答える 0