Table of Contents

Class PdfTextMarkupAnnotation

Namespace
Syncfusion.Pdf.Interactive
Assembly
Syncfusion.Pdf.Portable.dll

Represents the text markup annotation.

public class PdfTextMarkupAnnotation : PdfAnnotation, INotifyPropertyChanged
Inheritance
PdfTextMarkupAnnotation
Implements
Inherited Members

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create PDF font and PDF font style .
Font font = new Font("Calibri", 10, FontStyle.Bold);
PdfFont pdfFont = new PdfTrueTypeFont(font, false);
//Create a new pdf brush.
PdfBrush pdfBrush = new PdfSolidBrush(Color.Black);
//Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, new PointF(150, 10));
string markupText = "Text Markup";
SizeF size = pdfFont.MeasureString(markupText);
RectangleF rectangle = new RectangleF(175, 40, size.Width, size.Height);
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle);
//Create a pdf text markup annotation .
PdfTextMarkupAnnotation markupAnnotation = new PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, new PointF(175, 40), pdfFont);
markupAnnotation.TextMarkupColor = new PdfColor(Color.BlueViolet);
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
//Add this annotation to a new page.
page.Annotations.Add(markupAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create pdf font and pdf font style .
Dim font As New Font("Calibri", 10, FontStyle.Bold)
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, False)
'Create a new PDF brush.
Dim pdfBrush As PdfBrush = New PdfSolidBrush(Color.Black)
'Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, New PointF(150, 10))
Dim markupText As String = "Text Markup"
Dim size As SizeF = pdfFont.MeasureString(markupText)
Dim rectangle As New RectangleF(175, 40, size.Width, size.Height)
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle)
'Create a pdf text markup annotation .
Dim markupAnnotation As New PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, New PointF(175, 40), pdfFont)
markupAnnotation.TextMarkupColor = New PdfColor(Color.BlueViolet)
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight
'Add this annotation to a new page.
page.Annotations.Add(markupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)

Constructors

PdfTextMarkupAnnotation()

Initializes new instance of PdfTextMarkupAnnotation class.

public PdfTextMarkupAnnotation()

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create PDF font and font style .
Font font = new Font("Calibri", 10, FontStyle.Bold);
PdfFont pdfFont = new PdfTrueTypeFont(font, false);
//Create a new PDF brush.
PdfBrush pdfBrush = new PdfSolidBrush(Color.Black);
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, new PointF(150, 10));
string markupText = "Text Markup";
SizeF size = pdfFont.MeasureString(markupText);
RectangleF rectangle = new RectangleF(175, 40, size.Width, size.Height);
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle);
//Create a pdf text markup annotation  .
PdfTextMarkupAnnotation markupAnnotation = new PdfTextMarkupAnnotation();
markupAnnotation.Text = "Text Markup annotation";
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
//Add this annotation to a new page.
page.Annotations.Add(markupAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create pdf font and font style .
Dim font As New Font("Calibri", 10, FontStyle.Bold)
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, False)
'Create a new PDF brush.
Dim pdfBrush As PdfBrush = New PdfSolidBrush(Color.Black)
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, New PointF(150, 10))
Dim markupText As String = "Text Markup"
Dim size As SizeF = pdfFont.MeasureString(markupText)
Dim rectangle As New RectangleF(175, 40, size.Width, size.Height)
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle)
'Create a pdf text markup annotation  .
Dim markupAnnotation As New PdfTextMarkupAnnotation()
markupAnnotation.Text = "Text Markup annotation"
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight
'Add this annotation to a new page.
page.Annotations.Add(markupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

PdfTextMarkupAnnotation(RectangleF)

Initializes new instance of PdfTextMarkupAnnotation class with specified bounds.

public PdfTextMarkupAnnotation(RectangleF rectangle)

Parameters

rectangle RectangleF

The bounds of the annotation.

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create PDF font and font style .
PdfFont pdfFont = new PdfStandardFont(PdfFontFamily.Helvetica, fontSize);
//Create a new PDF brush.
PdfBrush pdfBrush = new PdfSolidBrush(Color.Black);
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, new PointF(150, 10));
string markupText = "Text Markup";
SizeF size = pdfFont.MeasureString(markupText);
RectangleF rectangle = new RectangleF(175, 40, size.Width, size.Height);
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle);
//Create a pdf text markup annotation  .
PdfTextMarkupAnnotation markupAnnotation = new PdfTextMarkupAnnotation(rectangle);
markupAnnotation.TextMarkupColor = new PdfColor(Color.BlueViolet);
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
//Add this annotation to a new page.
page.Annotations.Add(markupAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create pdffont and pdffont style .
Dim pdfFont As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, fontSize)
'Create a new pdfbrush .
Dim pdfBrush As PdfBrush = New PdfSolidBrush(Color.Black)
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, New PointF(150, 10))
Dim markupText As String = "Text Markup"
Dim size As SizeF = pdfFont.MeasureString(markupText)
Dim rectangle As New RectangleF(175, 40, size.Width, size.Height)
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle)
'Create a pdf text markup annotation  .
Dim markupAnnotation As New PdfTextMarkupAnnotation(rectangle)
markupAnnotation.TextMarkupColor = New PdfColor(Color.BlueViolet)
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight
'Add this annotation to a new page.
page.Annotations.Add(markupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

PdfTextMarkupAnnotation(string, string, string, PointF, PdfFont)

Initializes new instance of PdfTextMarkupAnnotation class with specified title, markup text, annotation text and font.

public PdfTextMarkupAnnotation(string markupTitle, string text, string markupText, PointF point, PdfFont pdfFont)

Parameters

markupTitle string

The markup annotation title.

text string

The string specifies the text of the annotation.

markupText string

The string specifies the markup text of the annotation.

point PointF

The location of the markup text annotation.

pdfFont PdfFont

The PdfFont specifies the text appearance of the markup text annotation.

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create PDF font and font style .
Font font = new Font("Calibri", 10, FontStyle.Bold);
PdfFont pdfFont = new PdfTrueTypeFont(font, false);
//Create a new PDF brush.
PdfBrush pdfBrush = new PdfSolidBrush(Color.Black);
//Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, new PointF(150, 10));
string markupText = "Text Markup";
SizeF size = pdfFont.MeasureString(markupText);
RectangleF rectangle = new RectangleF(175, 40, size.Width, size.Height);
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle);
//Create a pdf text markup annotation.
PdfTextMarkupAnnotation markupAnnotation = new PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, new PointF(175, 40), pdfFont);
markupAnnotation.TextMarkupColor = new PdfColor(Color.BlueViolet);
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
//Add this annotation to a new page.
page.Annotations.Add(markupAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create PDF font and font style .
Dim font As New Font("Calibri", 10, FontStyle.Bold)
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, False)
'Create a new PDF brush.
Dim pdfBrush As PdfBrush = New PdfSolidBrush(Color.Black)
'Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, New PointF(150, 10))
Dim markupText As String = "Text Markup"
Dim size As SizeF = pdfFont.MeasureString(markupText)
Dim rectangle As New RectangleF(175, 40, size.Width, size.Height)
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle)
'Create a pdf text markup annotation.
Dim markupAnnotation As New PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, New PointF(175, 40), pdfFont)
markupAnnotation.TextMarkupColor = New PdfColor(Color.BlueViolet)
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight
'Add this annotation to a new page.
page.Annotations.Add(markupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

Properties

BoundsCollection

Gets or sets text markup bounds collection.

public List<RectangleF> BoundsCollection { get; set; }

Property Value

List<RectangleF>

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create pdf font and pdf font style .
Font font = new Font("Calibri", 10, FontStyle.Bold);
PdfFont pdfFont = new PdfTrueTypeFont(font, false);
//Create a new PdfBrush.
PdfBrush pdfBrush = new PdfSolidBrush(Color.Black);
//Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, new PointF(150, 10));
string markupText = "Text Markup";
SizeF size = pdfFont.MeasureString(markupText);
RectangleF rectangle = new RectangleF(175, 40, size.Width, size.Height);
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle);
//Create a pdf text markup annotation .
PdfTextMarkupAnnotation markupAnnotation = new PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, new PointF(175, 40), pdfFont);
markupAnnotation.TextMarkupColor = new PdfColor(Color.BlueViolet);
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
List<RectangleF> bounds = new List<RectangleF>() { new RectangleF(200, 100, 60, 30), new RectangleF(100, 400, 60, 30) };
markupAnnotation.BoundsCollection = bounds;
//Add this annotation to a new page.
page.Annotations.Add(markupAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create PDF font and font style .
Dim font As New Font(Calibri", 10, FontStyle.Bold)
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, False)
'Create a new PdfBrush.
Dim pdfBrush As PdfBrush = New PdfSolidBrush(Color.Black)
'Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, New PointF(150, 10))
Dim markupText As String = "Text Markup"
Dim size As SizeF = pdfFont.MeasureString(markupText)
Dim rectangle As New RectangleF(175, 40, size.Width, size.Height)
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle)
'Create a PDF text markup annotation .
Dim markupAnnotation As New PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, New PointF(175, 40), pdfFont)
markupAnnotation.TextMarkupColor = New PdfColor(Color.BlueViolet)
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight
Dim bounds As List(Of RectangleF) = New List(Of RectangleF)() From { New RectangleF(200, 100, 60, 30), New RectangleF(100, 400, 60, 30)}
markupAnnotation.BoundsCollection = bounds
'Add this annotation to a new page.
page.Annotations.Add(markupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

Comments

Gets the annotation comments

public PdfPopupAnnotationCollection Comments { get; }

Property Value

PdfPopupAnnotationCollection

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create PDF font and PDF font style .
Font font = new Font("Calibri", 10, FontStyle.Bold);
PdfFont pdfFont = new PdfTrueTypeFont(font, false);
//Create a new pdf brush.
PdfBrush pdfBrush = new PdfSolidBrush(Color.Black);
//Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, new PointF(150, 10));
string markupText = "Text Markup";
SizeF size = pdfFont.MeasureString(markupText);
RectangleF rectangle = new RectangleF(175, 40, size.Width, size.Height);
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle);
//Create a pdf text markup annotation .
PdfTextMarkupAnnotation markupAnnotation = new PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, new PointF(175, 40), pdfFont);
markupAnnotation.TextMarkupColor = new PdfColor(Color.BlueViolet);
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
PdfPopupAnnotation popupComments = new PdfPopupAnnotation();
popupComments.Author = "TestAuthor";
popupComments.Text = "Test Text";
markupAnnotation.Comments.Add(popupComments);
//Get annotation comments
PdfPopupAnnotationCollection commentsCollection = markupAnnotation.Comments;
//Saves the document to disk.
document.Save("Output.pdf");
document.Close(true);
Dim document As PdfDocument = New PdfDocument
Dim page As PdfPage = document.Pages.Add
Dim font As Font = New Font("Calibri", 10, FontStyle.Bold)
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, false)
Dim pdfBrush As PdfBrush = New PdfSolidBrush(Color.Black)
'Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, New PointF(150, 10))
Dim markupText As String = "Text Markup"
Dim size As SizeF = pdfFont.MeasureString(markupText)
Dim rectangle As RectangleF = New RectangleF(175, 40, size.Width, size.Height)
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle)
Dim markupAnnotation As PdfTextMarkupAnnotation = New PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, New PointF(175, 40), pdfFont)
markupAnnotation.TextMarkupColor = New PdfColor(Color.BlueViolet)
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight
Dim popupComments As PdfPopupAnnotation = New PdfPopupAnnotation
popupComments.Author = "TestAuthor"
popupComments.Text = "Test Text"
markupAnnotation.Comments.Add(popupComments)
Dim commentsCollection As PdfPopupAnnotationCollection = markupAnnotation.Comments
'Saves the document to disk.
document.Save("Output.pdf")
document.Close(true)
See Also

ReviewHistory

Gets the annotation reviews

public PdfPopupAnnotationCollection ReviewHistory { get; }

Property Value

PdfPopupAnnotationCollection

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create PDF font and PDF font style .
Font font = new Font("Calibri", 10, FontStyle.Bold);
PdfFont pdfFont = new PdfTrueTypeFont(font, false);
//Create a new pdf brush.
PdfBrush pdfBrush = new PdfSolidBrush(Color.Black);
//Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, new PointF(150, 10));
string markupText = "Text Markup";
SizeF size = pdfFont.MeasureString(markupText);
RectangleF rectangle = new RectangleF(175, 40, size.Width, size.Height);
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle);
//Create a pdf text markup annotation .
PdfTextMarkupAnnotation markupAnnotation = new PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, new PointF(175, 40), pdfFont);
markupAnnotation.TextMarkupColor = new PdfColor(Color.BlueViolet);
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
// set review state
PdfPopupAnnotation popup = new PdfPopupAnnotation();
popup.State = PdfAnnotationState.Accepted;
popup.StateModel = PdfAnnotationStateModel.Review;
popup.Text = "Hello PDF Comments";
markupAnnotation.ReviewHistory.Add(popup);
//Get Review history
PdfPopupAnnotationCollection reviewCollection = markupAnnotation.ReviewHistory;
//Saves the document to disk.
document.Save("Output.pdf");
document.Close(true);
Dim document As PdfDocument = New PdfDocument
Dim page As PdfPage = document.Pages.Add
Dim font As Font = New Font("Calibri", 10, FontStyle.Bold)
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, false)
Dim pdfBrush As PdfBrush = New PdfSolidBrush(Color.Black)
'Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, New PointF(150, 10))
Dim markupText As String = "Text Markup"
Dim size As SizeF = pdfFont.MeasureString(markupText)
Dim rectangle As RectangleF = New RectangleF(175, 40, size.Width, size.Height)
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle)
Dim markupAnnotation As PdfTextMarkupAnnotation = New PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, New PointF(175, 40), pdfFont)
markupAnnotation.TextMarkupColor = New PdfColor(Color.BlueViolet)
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight
Dim popup As PdfPopupAnnotation = New PdfPopupAnnotation
popup.State = PdfAnnotationState.Accepted
popup.StateModel = PdfAnnotationStateModel.Review
popup.Text = "Hello PDF Comments"
markupAnnotation.ReviewHistory.Add(popup)
Dim reviewCollection As PdfPopupAnnotationCollection = markupAnnotation.ReviewHistory
'Saves the document to disk.
document.Save("Output.pdf")
document.Close(true)
See Also

TextMarkupAnnotationType

Gets or sets TextMarkupAnnotationType.

public PdfTextMarkupAnnotationType TextMarkupAnnotationType { get; set; }

Property Value

PdfTextMarkupAnnotationType

The TextMarkupAnnotationType enumeration value which contains the different types of mark up annotation types.

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create PDF font and font style .
Font font = new Font("Calibri", 10, FontStyle.Bold);
PdfFont pdfFont = new PdfTrueTypeFont(font, false);
//Create a new PDF brush.
PdfBrush pdfBrush = new PdfSolidBrush(Color.Black);
//Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, new PointF(150, 10));
string markupText = "Text Markup";
SizeF size = pdfFont.MeasureString(markupText);
RectangleF rectangle = new RectangleF(175, 40, size.Width, size.Height);
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle);
//Create a PDF text markup annotation .
PdfTextMarkupAnnotation markupAnnotation = new PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, new PointF(175, 40), pdfFont);
markupAnnotation.TextMarkupColor = new PdfColor(Color.BlueViolet);
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
//Add this annotation to a new page.
page.Annotations.Add(markupAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create pdf font and pdf font style .
Dim font As New Font("Calibri", 10, FontStyle.Bold)
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, False)
'Create a new PdfBrush.
Dim pdfBrush As PdfBrush = New PdfSolidBrush(Color.Black)
'Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, New PointF(150, 10))
Dim markupText As String = "Text Markup"
Dim size As SizeF = pdfFont.MeasureString(markupText)
Dim rectangle As New RectangleF(175, 40, size.Width, size.Height)
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle)
'Create a pdf text markup annotation .
Dim markupAnnotation As New PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, New PointF(175, 40), pdfFont)
markupAnnotation.TextMarkupColor = New PdfColor(Color.BlueViolet)
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight
'Add this annotation to a new page.
page.Annotations.Add(markupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

TextMarkupColor

Gets or sets text markup color.

public PdfColor TextMarkupColor { get; set; }

Property Value

PdfColor

The PdfColor draws the outline of the annotation.

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create pdf font and pdf font style .
Font font = new Font("Calibri", 10, FontStyle.Bold);
PdfFont pdfFont = new PdfTrueTypeFont(font, false);
//Create a new PdfBrush.
PdfBrush pdfBrush = new PdfSolidBrush(Color.Black);
//Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, new PointF(150, 10));
string markupText = "Text Markup";
SizeF size = pdfFont.MeasureString(markupText);
RectangleF rectangle = new RectangleF(175, 40, size.Width, size.Height);
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle);
//Create a pdf text markup annotation .
PdfTextMarkupAnnotation markupAnnotation = new PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, new PointF(175, 40), pdfFont);
markupAnnotation.TextMarkupColor = new PdfColor(Color.BlueViolet);
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
//Add this annotation to a new page.
page.Annotations.Add(markupAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create PDF font and font style .
Dim font As New Font(Calibri", 10, FontStyle.Bold)
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, False)
'Create a new PdfBrush.
Dim pdfBrush As PdfBrush = New PdfSolidBrush(Color.Black)
'Draw text in the new page.
page.Graphics.DrawString("Text Markup Annotation Demo", pdfFont, pdfBrush, New PointF(150, 10))
Dim markupText As String = "Text Markup"
Dim size As SizeF = pdfFont.MeasureString(markupText)
Dim rectangle As New RectangleF(175, 40, size.Width, size.Height)
page.Graphics.DrawString(markupText, pdfFont, pdfBrush, rectangle)
'Create a PDF text markup annotation .
Dim markupAnnotation As New PdfTextMarkupAnnotation("Markup annotation", "Markup annotation with highlight style", markupText, New PointF(175, 40), pdfFont)
markupAnnotation.TextMarkupColor = New PdfColor(Color.BlueViolet)
markupAnnotation.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight
'Add this annotation to a new page.
page.Annotations.Add(markupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

Methods

Initialize()

Initializes Annotation object.

protected override void Initialize()
See Also

Save()

Saves an Text Markup Annotation .

protected override void Save()
See Also

See Also