Search results

PdfFontFamily

Specifies the font family from the standard font.

// create a new PDF document
let document : PdfDocument = new PdfDocument();
// add a new page to the document
let page1 : PdfPage = document.pages.add();
// create new standard font
let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);
// create black brush
let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));
// draw the text
page1.graphics.drawString('Hello World', font, blackBrush, new PointF(0, 0));
// save the document
document.save('output.pdf');
  • Courier
  • Helvetica
  • Symbol
  • TimesRoman
  • ZapfDingbats