itext PDF - Greek letters are not appearing in the resulting PDF document

前端 未结 3 777
春和景丽
春和景丽 2021-01-14 16:20

I am having hard time trying to generate PDF files containing Greek letters using itextpdf. I am reading the strings from an external source as UTF-8 strings. English letter

3条回答
  •  伪装坚强ぢ
    2021-01-14 16:56

    I used this code:

    BaseFont fonty = BaseFont.createFont("assets/ARIALBD.TTF", BaseFont.IDENTITY_H,       BaseFont.NOT_EMBEDDED);
         fonty.setSubset(true);
         Phrase myName = new Phrase("Your Not Latin Words", new Font(fonty,12));
         ColumnText.showTextAligned(canvas,
                 Element.ALIGN_LEFT, myName, 66, 400, 0);
    

    i had to paste the ARIALBD.TTF to assets folder

提交回复
热议问题