PdfDocumentProcessor.AddTextAnnotation(Int32, PdfPoint) Method
Adds a text annotation at the specified point on the page.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Docs.v20.2.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
pageNumber | Int32 | The number of the page to add the text annotation. |
location | PdfPoint | The point on the page to position the text annotation. |
Returns
Type | Description |
---|---|
PdfTextAnnotationData | The text annotation. |
Remarks
The code sample below highlights text with blue and adds a sticky note at the page corner.
using DevExpress.Pdf;
//...
using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
//Load a document:
processor.LoadDocument("..\\..\\Document.pdf");
//Add a text markup annotation at the first page:
PdfTextMarkupAnnotationData textMarkup =
processor.AddTextMarkupAnnotation(1, new PdfRectangle(90, 100, 240, 230),
PdfTextMarkupAnnotationType.Highlight);
if (textMarkup != null)
{
//Specify the annotation properties:
textMarkup.Author = "Bill Smith";
textMarkup.Contents = "Important!";
textMarkup.Color = new PdfRGBColor(0.8, 0.2, 0.1);
}
//Add a sticky note at the first page:
PdfTextAnnotationData textAnnotation =
processor.AddTextAnnotation(1, new PdfPoint(100, 300));
//Specify the annotation parameters:
textAnnotation.Author = "Nancy Davolio";
textAnnotation.Checked = true;
textAnnotation.Color = new PdfRGBColor(0.8, 0.2, 0.1);
textAnnotation.Contents = "Please proofread this document";
textAnnotation.IconName = PdfTextAnnotationIconName.Check;
//Save the result:
processor.SaveDocument("..\\..\\Result.pdf");
}
See Also
Feedback