1

How do I use material ui icons as font while creating a PDF document. I am trying to use MaterialIcons-Regular.ttf as the font.

Is there any example I can refer to. or is there a better way of handling font icons in PDF docs using itext7.

1 Answers1

1

I'm not completely sure what you're asking but it should go like this:

PdfFont f1 = PdfFontFactory.createFont("MaterialIcons-Regular.ttf", "Identity-H", true);
Paragraph p1 = new Paragraph("Testing of symbols \ue000,\ue0bb").setFont(f1);

Note that the characters are in the private area. Install the font in windows and use the character map application to locate the charactres.

Paulo Soares
  • 1,896
  • 8
  • 21
  • 19