Knowledge Base - Create Font object

Knowledge Base - Create Font object

To create a font object, to be used to write text to the PDF, you need to do the following:

  1. Add the font file to the assets, and make sure to set the Advanced properties as:
  2. Add it to the font file list.
    • PDFGlobal.FontFileListStart();
      PDFGlobal.FontFileListAdd(inst_path + "\\Assets\\font\\your font.ttf");
      PDFGlobal.FontFileListEnd();
  3. Get the font face name, by enumerating all the fonts and search for the one you just added.
    • int face_first = 0;
      int face_count = PDFGlobal.GetFaceCount();
      String fname = null;
      while (face_first < face_count)
      {
      fname = PDFGlobal.GetFaceName(face_first);
      face_first++;
      }
  4. Create the font object.
    • PDFDocFont dfont = pdfDoc.NewFontCID(fname, 8);

Note: A premium license is needed for this feature.

Applies To

RadaeePDF SDK for Windows 10

Details

Created : 2017-10-24 11:17:22, Last Modified : 2017-10-24 11:31:21