Guide for C#
Core Document Formats
Additional Features
Text Annotation

C# Imaging - Create & Process Image Text Annotation

Visual C# Code to Add Text Annotation to Document Image File

Visual C#
Home > .NET Imaging SDK > C# > Text Annotating
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

C# Text Annotation Overview
RasterEdge C#.NET Text Annotator Control SDK is an efficient .NET solution which can help C# developers add text comment to source document files like PDF or image files like TIFF in a programming way.
Related .net document control helps: view powerpoint: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET mvc display tiff: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control edit pdf image control: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C# mvc image viewer: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery pdf document viewer c#: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm... view text file in browser: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET pdf editor component: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
In order to help you have a comprehensive and quick grasp of this C#.NET Text Annotator Control SDK, we arrange this online tutorial page in following way.
  • Key features of RasterEdge C# text annotating library assembly
  • How to install & use this C#.NET text annotator control SDK
  • Method to create text annotation in C#.NET class application
  • Sample C# code for text annotation in .NET project
  • C#.NET text annotating control add-on FAQs
C# Text Annotating Control Features
  • Able to add text annotation to common raster image files using C# code
  • Created text annotation can be directly saved as an image object using C# code
  • Allow C# developers to add shadow to text annotation by C# code
  • Able to add background fill and border to image text annotation using simple C# code
  • The text font style can be easily adjusted in C#.NET class application
  • Offer separate C# code to resize and reposition image text annotation in .NET
Apart from this C#.NET text annotating control toolkit, RasterEdge Annotator SDK also contains other advanced annotating libraries that you may be interested in, like C#.NET ellipse annotating library, hotspot annotating library, callout annotating library and rubber stamp annotating library.
Add Text Annotation in C#.NET Application
If you are wondering how to integrate RasterEdge C#.NET text annotator into your .NET class application, the step-by-step guidance from this section will surely help solve your problem. Before integrating this C#.NET text annotating control to your C#.NET class application, please make sure you have met the minimum installation requirements (Visual Studio 2005 or above and .NET Framework 2.0 or above).
  1. Find following dlls (which are used to create text annotation by C#.NET code) from downloaded trial suite of RasterEdge DocImage SDK for .NET;
    • RasterEdge .Imaging.Basic.dll
    • RasterEdge .Imaging.Annotation.dll
  2. Copy RasteEdge evaluation license key (which you can get by running "RasterEdge.Imaging License Manager.exe") at your C# project bin folder;
  3. Now you are ready to create text annotation in your C# imaging application with the sample C# code we provide in the following section.
If you want to add text annotation to your source document image file using VB.NET programming code, please follow this link to VB.NET text annotator control.
C#.NET Method to Add Image Text Annotation
This is the method that RasterEdge C#.NET text annotation control has used to create customized document image text annotation in C#.NET class application.
public static TextAnnotation CreateTextAnnotation(float x, float y, float w, float h, string text, Font font);
public static TextAnnotation CreateTextAnnotation(float x, float y, float w, float h, string text, Font font, AnnotationBrush fontBrush,
AnnotationPen outline, AnnotationBrush fill, AnnotationBrush shadow, float shadowX, float shadowY);
Sample C# Code to Add Image Text Annotation
Using the sample C# code below, you can easily specify the x & y co-ordinates where you want to place the text and adjust the text font style. Besides, to highlight added text, you can also add border and filled background to the created image text annotation.
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using RasterEdge.Imaging.Annotation;
using System.Diagnostics;
using RasterEdge.Imaging.Annotation.Basic;

namespace RasterEdge.Imaging.Demo.Annotation
public class TextAnnotationDemo
* SDK Dependency:
* RasterEdge.Imaging.Annotation.dll

public static void Test()
TextAnnotation obj = new TextAnnotation();

obj.Text = "This is a Text";//set the showing text
obj.TextFont = new Font("Arial", 12.0F, FontStyle.Italic);//set text font

//set filled font property
obj.FontBrush = new AnnotationBrush();
obj.FontBrush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set filled font style
obj.FontBrush.Solid_Color = Color.DarkBlue;//set filled font color

obj.Padding = 1;//set text padding

// set annotation size
obj.X = 60.0F;
obj.Y = 45.0F;
obj.Width = 250.0F;
obj.Height = 40.0F;

//set annotation edge property
obj.OutLine = new LinePen();
obj.OutLine.Width = 2.0F;//set edge width
obj.OutLine.Brush = new AnnotationBrush();
obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set annotation edge style
obj.OutLine.Brush.Solid_Color = Color.White;//set annotation edge color

//set filled shape property
obj.Fill = new AnnotationBrush();
obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set filled shapes style
obj.Fill.Solid_Color = Color.Gray;//set filled shapes color

//set shadow property
obj.ShadowFill = new AnnotationBrush();
obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set shadow style
obj.ShadowFill.Solid_Color = Color.Blue;//set shadow color
obj.ShadowX = 10.0F;//set shadow position
obj.ShadowY = 12.0F;
obj.ShowShadow = true;//show shadow or not

string folderName = "C:/";
Bitmap img = obj.CreateAnnotation();
img.Save(folderName + "TextAnnotation.png");
catch (Exception ex)
C#.NET Text Annotator Control FAQs
Q 1: Does RasterEdge C#.NET Text Annotator Add-on allow developers to format created text using Visual C# programming code in .NET class application?
A 1: Yes, using RasterEdge C#.NET Image Text Annotator Control SDK, developers can easily apply various kinds of formatting features to created text annotation, like bold, italics and underline.

Q 2: I want to add a text annotation to my PDF document and I want the added text annotation to be horizontally aligned (left, center, or right) or vertically aligned (top, middle or bottom). Can RasterEdge C#.NET Text Annotator Control help me align the text by C# code?
A 2: Sorry, currently, RasterEdge C#.NET Image Text Annotator Control Add-on has not yet designed the text aligning functions.

Q 3: Can RasterEdge C#.NET Image Text Annotation Library support adding a link to the text in C#.NET class application?
A 3: Sorry, the current version of RasterEdge C#.NET Image Text Annotator Add-on does not support adding a link to the created text annotation.

Recommend this to Google+ is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster