How To Highlight Annotation To PDF Documents Using PDF Mosaic .NET

This sample shows how to add highlight annotations to your PDF document.

Use PDFHighlightAnnotation class to highlight annotation.

PDF Highlight Annotation

 

using PDFMosaic;
using System;

namespace PDFHighlightAnnotationSample
{
    class PDFHighlightAnnotationSample
    {
        static void Main()
        {
            PDFDocument pdf = new PDFDocument();
            pdf.Pages.Add(new PDFPage(PDFPaperFormat.A4));
            PDFHighlightAnnotation annot = new PDFHighlightAnnotation(100, 50, 75, 50);
            annot.Contents = "PDF highlight annotation";
            annot.Color = new PDFColorRGB(0, 250, 0);

            pdf.Pages[0].Annotations.Add(annot);
            pdf.Save("TestHighlightAnnotation.pdf", true);
        }
    }
}