Guide for VB.NET
Core Document Formats
Word Annotation
Additional Features

VB.NET Word - Word Annotating Using VB

VB.NET Code to Add and Customize Annotation on Word Page

VB.NET
Home > .NET Imaging SDK > VB.NET > Word Annotation
To get started with DocImage SDK for .NET, you are supposed to read VB.NET Imaging: Get Started first!

If you are looking for an easy to use Word document annotation add-on that can create all the primary annotation types on single or multiple Word file pages in VB.NET application, you will have a strong interest in this VB.NET Word annotating tutorial page. Following is a brief article layout.
Related .net document control helps:
asp.net tiff viewer: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net mvc pdf editor: ASP.NET MVC PDF Viewer & Editor: view, annotate, redact, edit PDF document in C# ASP.NET MVC
asp.net pdf viewer: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
asp.net edit pdf text: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
asp.net powerpoint viewer: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net text file viewer: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net pdf page: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
  • What VB.NET APIs are offered for developers to annotate source Word document file?
  • How to add & burn various customized annotation images on Word .docx file in VB.NET code?
Annotation APIs
This VB.NET Word annotation control SDK actually integrates .NET Imaging Annotation SDK Library and VB.NET Word Reading Component Add-on. Thus, from this VB.NET Word annotator library SDK, you can find mature VB.NET APIs to decode, encode and annotate source Word .docx document file.
Using the following VB.NET Word annotating APIs, you can easily add & burn specified annotation image on selected Word document page.
Private Function AddFloatingItem(item As BaseItem) As Integer Implements DOCXPage.AddFloatingItem
End Function
Private Sub MergeItemsToPage() Implements DOCXPage.MergeItemsToPage
End Sub
Tips: to help you have a deep understanding of above VB.NET Word annotating APIs, we will make some introductions for some programming classes and the working principle of this Word annotation component SDK for VB.NET first.
  • DOCXDocument: within the whole VB.NET Word editing control add-on, one in-memory Word document file will be represented as a DOCXDocument object. Therefore, this DOCXDocument class can be counted as a high-level model to display .docx document file in .NET developing application.
  • DOCXPage: as for the page contained in DOCXDocument file, RasterEdge uses one DOCXPage instance to display it. Thus, in general, one DOCXDocument object contains a list of DOCXPage instances.
  • Word annotating process: when you create and add a fully customized annotation image to selected DOCXPage object, this Word annotation control in VB.NET will automatically create a REImage and burn it at defined Word location. As the Word annotation burning process fully implements Word coordinates system, developers only need to specify the coordinates of position and annotation size in local settings. Then they can fully complete VB.NET Word annotating process.
VB.NET Demo Codes
The available types for this VB.NET Word annotation control add-on contains callout annotation, embedded image annotation, ellipse annotation, free hand annotation, free hand line annotation, hotspot annotation, hotspot free hand annotation, line annotation, lines annotation, rectangle annotation, rubber stamp annotation and text annotation.
And here we list separate VB.NET programming codes for each supported Word annotating type. If you have any problem in testing following VB.NET Word annotation sample codes, please free to contact our technical support team via E-mail. To view sample C# code for Word annotating application, please follow this link to C#.NET Word annotating tutorial.
Word Annotation: Annotate Word Doc Page with Callout Annotation
''' < summary>
''' Draw and burn a callout annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
Demo VB.NET Code: Embedded Image Annotation on Word Doc Page
''' < summary>
''' Draw and burn an embedded image annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
VB.NET Tutorial: Add Ellipse Annotation to Word Doc Page
''' < summary>
''' Draw and burn an ellipse annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
VB.NET Tutorial: Print Free Hand Annotation on Word
''' < summary>
''' Draw and burn a free hand annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
Demo VB.NET Code: Draw Free Hand Line Annotation on Word
''' < summary>
''' Draw and burn a free hand line annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
Word Annotation: Hotspot Annotation Control for Word Document
''' < summary>
''' Draw and burn a hotspot annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
VB.NET Tutorial: Generate Hotspot Free Hand Annotation on Word Doc Page
''' < summary>
''' Draw and burn a hotspot free hand annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
Word Annotation: Print Line Image Annotation on Word Doc File
''' < summary>
''' Draw and burn a line image annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
Word Annotator: Add Lines Annotation on Word Doc Page
''' < summary>
''' Draw and burn lines annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
Demo VB.NET Code: Create Rectangle Annotation on Word Programmatically
''' < summary>
''' Draw and burn a rectangle annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
Demo VB.NET Code: Draw Rubber Stamp Annotation on Word Doc Page
''' < summary>
''' Draw and burn a rubber stamp annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub
Word Annotation: Mark Word Page with Text Annotation
''' < summary>
''' Draw and burn a text annotation on the first page of a Word document
''' < /summary>
Public Shared Sub DOCXAnotationDemo(filePath As [String], pageIdx As Integer, annotatedFilePath As [String])
   ' use DOCXDocument open a Word file
   Dim doc As DOCXDocument = DirectCast(REFile.OpenDocumentFile(filePath, New DOCXDecoder()), DOCXDocument)

   Dim newPage As BasePage = doc.GetPage(0)

   Dim obj As New RectangleAnnotation()
   ' set annotation size 
   obj.X = 470F
   obj.Y = 420F
   obj.Width = 561F
   obj.Height = 228F

   ' set annotation edge property
   obj.OutLine = New LinePen()
   ' set annotation edge width
   obj.OutLine.Width = 5F
   obj.OutLine.Brush = New AnnotationBrush()
   ' set annotation edge style
   obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set annotation edge color
   obj.OutLine.Brush.Solid_Color = Color.Blue

   ' set the property of filled shape
   obj.Fill = New AnnotationBrush()
   ' set filled shape style
   obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set filled shape color 
   obj.Fill.Solid_Color = Color.Gray

   ' set the property of shadow
   obj.ShadowFill = New AnnotationBrush()
   ' set shadow style
   obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid
   ' set shadow color
   obj.ShadowFill.Solid_Color = Color.DarkGreen
   ' set shadow position
   obj.ShadowX = 10F
   obj.ShadowY = 12F
   ' show shadow or not
   obj.ShowShadow = True

   obj.SetTransparency(0.5F)

   Dim item As RasterEdge.Imaging.Drawing.REItemEx = obj.CreateAnnotationItem(newPage)
   newPage.AddFloatingItem(item)

   newPage.MergeItemsToPage()

   REFile.SaveDocumentFile(doc, annotatedFilePath, New DOCXEncoder())
End Sub

Apart from Word Annotation Add-on tool for Visual Basic .NET program, you still have abilities to incorporate other document and image annotation libraries within your single or multi-threaded VB.NET document or image applications. Here, we list some of them as below:


Recommend this to Google+


RasterEdge.com 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 Edge.com