Back to Devexpress

PdfViewerAnnotationBuilderExtensions.AsMarkupAnnotationBuilder(IPdfViewerAnnotationBuilder) Method

officefileapi-devexpress-dot-pdf-dot-pdfviewerannotationbuilderextensions-dot-asmarkupannotationbuilder-x28-devexpress-dot-pdf-dot-ipdfviewerannotationbuilder-x29.md

latest2.6 KB
Original Source

PdfViewerAnnotationBuilderExtensions.AsMarkupAnnotationBuilder(IPdfViewerAnnotationBuilder) Method

Casts the IPdfViewerAnnotationBuilder object to the IPdfViewerMarkupAnnotationBuilder object.

Namespace : DevExpress.Pdf

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

NuGet Package : DevExpress.Pdf.Drawing

Declaration

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

Parameters

NameTypeDescription
builderIPdfViewerAnnotationBuilder

Current IPdfViewerAnnotationBuilder object.

|

Returns

TypeDescription
IPdfViewerMarkupAnnotationBuilder

The object that contain information about the markup annotation.

|

Remarks

Use the AsMarkupAnnotationBuilder method to retrieve markup annotation parameters, as shown below:

csharp
private void PdfViewer_MarkupAnnotationCreating(object sender,
PdfAnnotationCreatingEventArgs e)
{
    if (e.Builder.AnnotationType == PdfAnnotationType.TextMarkup)
    {
        IPdfViewerMarkupAnnotationBuilder builder =
        e.Builder.AsMarkupAnnotationBuilder();
        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.AsMarkupAnnotationBuilder()
    builder.Author = "John Smith"
  End If
End Sub

See Also

PdfViewerAnnotationBuilderExtensions Class

PdfViewerAnnotationBuilderExtensions Members

DevExpress.Pdf Namespace