How To Add Type1 Font In PDF Document Generated by .NET Library PDF Mosaic

This example demonstrates how to add and use type1 font.

Type1 Font

C# :

using PDFMosaic;
using System.Drawing;

namespace Type1Fonts
  class Type1Fonts
    static void Main()
      PDFDocument document = new PDFDocument();
      document.Pages.Add(new PDFPage(PDFPaperFormat.A4));
      PDFCanvas canvas = document.Pages[0].Canvas;

      PDFBrush brush = new PDFSolidBrush();

      PDFFont fontType1 = new PDFFont("AGReverence", 12);
      canvas.DrawString("The Type1 font.", fontType1, brush, 10, 60);

      document.Save("Type1Fonts.pdf", true);


Imports PDFMosaic
Imports System.Drawing

Module Type1Fonts
  Sub Main()    
    Dim document As New PDFDocument()
    document.Pages.Add(New PDFPage(PDFPaperFormat.A4))
    Dim canvas = document.Pages(0).Canvas

    Dim brush As New PDFSolidBrush()

    Dim fontType1 As New PDFFont("AGReverence", 12)
    canvas.DrawString("The Type1 Font.", fontType1, brush, 10, 120)

    document.Save("Type1Fonts.pdf", True)
  End Sub
End Module