Back to Devexpress

PdfViewerAnnotationBuilderExtensions.AsTextMarkupAnnotationBuilder(IPdfViewerMarkupAnnotationBuilder) Method

officefileapi-devexpress-dot-pdf-dot-pdfviewerannotationbuilderextensions-dot-astextmarkupannotationbuilder-x28-devexpress-dot-pdf-dot-ipdfviewermarkupannotationbuilder-x29.md

latest2.9 KB
Original Source

PdfViewerAnnotationBuilderExtensions.AsTextMarkupAnnotationBuilder(IPdfViewerMarkupAnnotationBuilder) Method

Casts the IPdfViewerMarkupAnnotationBuilder object to the IPdfViewerTextMarkupAnnotationBuilder object.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Drawing.dll

NuGet Package : DevExpress.Pdf.Drawing

Declaration

csharp
public static IPdfViewerTextMarkupAnnotationBuilder AsTextMarkupAnnotationBuilder(
    this IPdfViewerMarkupAnnotationBuilder builder
)
vb
<ExtensionAttribute>
Public Shared Function AsTextMarkupAnnotationBuilder(
    builder As IPdfViewerMarkupAnnotationBuilder
) As IPdfViewerTextMarkupAnnotationBuilder

Parameters

NameTypeDescription
builderIPdfViewerMarkupAnnotationBuilder

Current IPdfViewerMarkupAnnotationBuilder object.

|

Returns

TypeDescription
IPdfViewerTextMarkupAnnotationBuilder

The IPdfViewerTextMarkupAnnotationBuilder object that contains text markup annotation parameters.

|

Remarks

The code sample below calls the PdfViewerAnnotationBuilderExtensions.AsTextMarkupAnnotationBuilder method to specify an author for all created text markup annotations:

csharp
private void PdfViewer_MarkupAnnotationCreating(object sender, PdfAnnotationCreatingEventArgs e)
{
    if (e.Builder.AnnotationType == PdfAnnotationType.TextMarkup)
    {
      IPdfViewerMarkupAnnotationBuilder builder =
      e.Builder.AsTextMarkupAnnotationBuilder();
      builder.Author = "John Smith";

    }
}
vb
Private Sub PdfViewer_MarkupAnnotationCreating(ByVal sender As Object, ByVal e As PdfAnnotationCreatingEventArgs)
    If e.Builder.AnnotationType = PdfAnnotationType.TextMarkup Then
        Dim builder As IPdfViewerMarkupAnnotationBuilder = e.Builder.AsTextMarkupAnnotationBuilder()
        builder.Author = "John Smith"
    End If
End Sub

See Also

PdfViewerAnnotationBuilderExtensions Class

PdfViewerAnnotationBuilderExtensions Members

DevExpress.Pdf Namespace