This sample shows how to draw text on a canvas.

To draw text on a canvas, use PdfCanvas.DrawString or PdfCanvas.DrawText method. These methods draw text using current canvas font.

DrawString method draws a single line of text from the current text position (take a look at PdfCanvas.TextPosition property) or inscribed in specified rectangle. DrawText method allows to draw multiple lines of text.

C#
using System.Diagnostics;
using System.Drawing;

namespace BitMiracle.Docotic.Pdf.Samples
{
    public static class DrawText
    {
        public static void Main()
        {
            // NOTE: 
            // When used in trial mode, the library imposes some restrictions.
            // Please visit http://bitmiracle.com/pdf-library/trial-restrictions.aspx
            // for more information.

            string pathToFile = "DrawText.pdf";

            using (PdfDocument pdf = new PdfDocument())
            {
                PdfCanvas canvas = pdf.Pages[0].Canvas;

                canvas.DrawString(10, 50, "Hello, world!");

                const string longString = "Lorem ipsum dolor sit amet, consectetur adipisicing elit";
                canvas.DrawString(longString, new RectangleF(10, 70, 40, 150), PdfTextAlign.Left, PdfVerticalAlign.Top);
                canvas.DrawText(longString, new RectangleF(70, 70, 40, 150), PdfTextAlign.Left, PdfVerticalAlign.Top);

                pdf.Save(pathToFile);
            }

            Process.Start(pathToFile);
        }
    }
}
VB
Imports System.Diagnostics
Imports System.Drawing

Imports BitMiracle.Docotic.Pdf

Namespace BitMiracle.Docotic.Pdf.Samples
    Public NotInheritable Class DrawText
        Public Shared Sub Main()
            ' NOTE: 
            ' When used in trial mode, the library imposes some restrictions.
            ' Please visit http://bitmiracle.com/pdf-library/trial-restrictions.aspx
            ' for more information.

            Dim pathToFile As String = "DrawText.pdf"

            Using pdf As New PdfDocument()
                Dim canvas As PdfCanvas = pdf.Pages(0).Canvas

                canvas.DrawString(10, 50, "Hello, world!")

                Const longString As String = "Lorem ipsum dolor sit amet, consectetur adipisicing elit"
                canvas.DrawString(longString, New RectangleF(10, 70, 40, 150), PdfTextAlign.Left, PdfVerticalAlign.Top)
                canvas.DrawText(longString, New RectangleF(70, 70, 40, 150), PdfTextAlign.Left, PdfVerticalAlign.Top)

                pdf.Save(pathToFile)
            End Using

            Process.Start(pathToFile)
        End Sub
    End Class
End Namespace