{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "pdf-viewer-annotations",
  "framework": "maui",
  "type": "registry:component",
  "component": "pdf-viewer",
  "variant": "annotations",
  "dependencies": [
    "Syncfusion.Maui.PdfViewer"
  ],
  "description": "Pdf viewer adds highlight, underline, free text, and stamp annotations on top of a remote PDF.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 2 (v34.1.29)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/maui/llms.txt",
    "skillPack": "syncfusion/maui-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/maui/pdf-viewer-annotations.md"
  },
  "files": [
    {
      "target": "src/components/pdf-viewer-annotations/PdfViewer.xaml",
      "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             xmlns:syncfusion=\"clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer\"\n             x:Class=\"MAUI.MainPage\"\n             Title=\"Annotations\"\n             BackgroundColor=\"White\">\n\n    <Grid>\n        <syncfusion:SfPdfViewer x:Name=\"PdfViewer\"\n                                ShowToolbars=\"True\"\n                                ShowScrollHead=\"True\"\n                                EnableTextSelection=\"True\"\n                                IsCommentsPanelVisible=\"True\"\n                                IsOutlineViewVisible=\"True\"\n                                DocumentLoaded=\"OnDocumentLoaded\" />\n    </Grid>\n\n</ContentPage>\n"
    },
    {
      "target": "src/components/pdf-viewer-annotations/PdfViewer.xaml.cs",
      "content": "﻿using Microsoft.Maui.Graphics;\nusing Syncfusion.Maui.PdfViewer;\n\nnamespace MAUI;\n\npublic partial class MainPage : ContentPage\n{\n    private const string DocumentUrl =\n        \"https://cdn.syncfusion.com/content/pdf/annotations-v2.pdf\";\n\n    public MainPage()\n    {\n        InitializeComponent();\n        _ = LoadDocumentAsync();\n    }\n\n    private async Task LoadDocumentAsync()\n    {\n        try\n        {\n            using var http = new HttpClient();\n            var bytes = await http.GetByteArrayAsync(DocumentUrl);\n            var stream = new MemoryStream(bytes);\n            PdfViewer.LoadDocument(stream);\n        }\n        catch (Exception ex)\n        {\n            await DisplayAlertAsync(\"Error\", $\"Failed to load document: {ex.Message}\", \"OK\");\n        }\n    }\n\n    private void OnDocumentLoaded(object? sender, EventArgs e)\n    {\n        AddTextMarkupAnnotations();\n        AddLineAndArrowAnnotations();\n        AddMeasurementAnnotations();\n        AddFreeTextAndStampAnnotations();\n        AddStickyNoteAnnotations();\n    }\n\n    private void AddTextMarkupAnnotations()\n    {\n        PdfViewer.AddAnnotation(new HighlightAnnotation(1, new List<RectF>\n        {\n            new RectF(70, 455, 340, 14)\n        }));\n\n        PdfViewer.AddAnnotation(new UnderlineAnnotation(1, new List<RectF>\n        {\n            new RectF(70, 525, 346, 14)\n        }));\n\n        PdfViewer.AddAnnotation(new StrikeOutAnnotation(1, new List<RectF>\n        {\n            new RectF(70, 598, 367, 14)\n        }));\n\n        PdfViewer.AddAnnotation(new SquigglyAnnotation(1, new List<RectF>\n        {\n            new RectF(70, 670.5f, 336, 14)\n        }));\n    }\n\n    private void AddLineAndArrowAnnotations()\n    {\n        PdfViewer.AddAnnotation(new LineAnnotation(\n            new[] { 90f, 160f, 350f, 170f }, 2, LineEndingStyle.None));\n\n        PdfViewer.AddAnnotation(new LineAnnotation(\n            new[] { 90f, 270f, 350f, 270f }, 2, LineEndingStyle.Open));\n\n        PdfViewer.AddAnnotation(new SquareAnnotation(\n            new RectF(90, 360, 150, 75), 2));\n\n        PdfViewer.AddAnnotation(new CircleAnnotation(\n            new RectF(90, 450, 90, 90), 2));\n\n        PdfViewer.AddAnnotation(new PolygonAnnotation(new List<PointF>\n        {\n            new PointF(90, 600),\n            new PointF(132, 571),\n            new PointF(179, 599),\n            new PointF(168, 642),\n            new PointF(101, 642)\n        }, 2));\n    }\n\n    private void AddMeasurementAnnotations()\n    {\n        PdfViewer.AddAnnotation(new PolylineAnnotation(new List<PointF>\n        {\n            new PointF(200, 260), new PointF(350, 260)\n        }, 3));\n\n        PdfViewer.AddAnnotation(new PolylineAnnotation(new List<PointF>\n        {\n            new PointF(200, 250), new PointF(285, 250), new PointF(286, 312)\n        }, 3));\n\n        PdfViewer.AddAnnotation(new PolygonAnnotation(new List<PointF>\n        {\n            new PointF(200, 350), new PointF(288, 349), new PointF(289, 403)\n        }, 3));\n\n        PdfViewer.AddAnnotation(new CircleAnnotation(new RectF(200, 460, 90, 90), 3));\n\n        PdfViewer.AddAnnotation(new PolygonAnnotation(new List<PointF>\n        {\n            new PointF(200, 610),\n            new PointF(200, 719),\n            new PointF(320, 719),\n            new PointF(320, 609)\n        }, 3));\n    }\n\n    private void AddFreeTextAndStampAnnotations()\n    {\n        PdfViewer.AddAnnotation(new FreeTextAnnotation(\n            \"Syncfusion\",\n            4,\n            new RectF(250, 60, 200, 40))\n        { FontSize = 16 });\n\n        PdfViewer.AddAnnotation(new StampAnnotation(\n            StampType.Approved, 4, new PointF(200, 220)));\n\n        PdfViewer.AddAnnotation(new StampAnnotation(\n            StampType.Confidential, 4, new PointF(200, 450)));\n    }\n\n    private void AddStickyNoteAnnotations()\n    {\n        PdfViewer.AddAnnotation(new StickyNoteAnnotation(\n            StickyNoteIcon.Note,\n            string.Empty,\n            6,\n            new PointF(300, 320)));\n    }\n}\n"
    }
  ]
}