PDF Mosaic: How to add highlight annotation to PDF documents


Home       Features       Download       Tutorial       Version History       License       Source Code

 

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

Use PDFHighlightAnnotation class to 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);
        }
    }
}

 


Home       Features       Download       Tutorial       Version History       License       Source Code