PDF Mosaic: How to create square annotations


Home       Features       Download       Tutorial       Version History       License       PDF Mosaic Blog       Source Code

 

This sample shows how to add square annotation to your PDF document.

How to add a square annotation to your PDF document in PDF Mosaic library
 

C# :

using PDFMosaic;
using System;
using System.Drawing;
 
namespace MarkupAnnotations
{
  class MarkupAnnotations
  {
    static void Main()
    {
      PDFDocument document = new PDFDocument();
      PDFPage page = new PDFPage(PDFPaperFormat.A4);
 
      PDFSquareAnnotation squareAnnotation = new PDFSquareAnnotation(60, 60, 80, 50);
      squareAnnotation.BorderEffect.Effect = PDFBorderEffect.Cloudy;
      squareAnnotation.BorderEffect.Intensity = 2;
      squareAnnotation.BackgroundColor = new PDFColorRGB(255, 0, 0);
      page.Annotations.Add(squareAnnotation);
 
      document.Pages.Add(page);
      document.Save("SquareAnnotation.pdf", true);
    }
  }
}

 

Visial Basic.NET :

Imports PDFMosaic
Imports System
Imports System.Drawing
 
Module MarkupAnnotations
  Sub Main()
    Dim document As New PDFDocument()
    Dim page As New PDFPage(PDFPaperFormat.A4)
 
    Dim squareAnnotation As New PDFSquareAnnotation(60, 60, 80, 50)
    squareAnnotation.BackgroundColor = New PDFColorRGB(255, 0, 0)
    squareAnnotation.BorderEffect.Effect = PDFBorderEffect.Cloudy
    squareAnnotation.BorderEffect.Intensity = 2
    page.Annotations.Add(squareAnnotation)
 
    document.Pages.Add(page)
    document.Save("SquareAnnotation.pdf", True)
  End Sub
End Module

 


Home       Features       Download       Tutorial       Version History       License       PDF Mosaic Blog       Source Code