# pdf-viewer-default

> Pdf viewer renders a remote PDF by URL with selection enabled, toolbars, and a fill layout.

**Framework:** maui  **Component:** pdf-viewer  **Variant:** default

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/maui/pdf-viewer-default.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.Maui.PdfViewer
```

**Notes**

- Syncfusion release: 2026 Volume 2 (v34.1.29)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/pdf-viewer-default/PdfViewer.xaml

```xaml
﻿<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer"
             x:Class="MAUI.MainPage">

    <Grid>
        <syncfusion:SfPdfViewer x:Name="PdfViewer"
                            EnableTextSelection="True"
                            ShowToolbars="True"
                            HorizontalOptions="Fill"
                            VerticalOptions="Fill"/>
    </Grid>

</ContentPage>

```

### src/components/pdf-viewer-default/PdfViewer.xaml.cs

```cs
﻿namespace MAUI
{
    public partial class MainPage : ContentPage
    {
        private const string DocumentUrl =
        "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
        
        public MainPage()
        {
            InitializeComponent();
            _ = LoadDocumentAsync();
        }

         private async Task LoadDocumentAsync()
        {
            try
            {
                using var http = new HttpClient();
                var bytes = await http.GetByteArrayAsync(DocumentUrl);
                var stream = new MemoryStream(bytes);
                PdfViewer.LoadDocument(stream);
            }
            catch (Exception ex)
            {
                await DisplayAlertAsync("Error", $"Failed to load document: {ex.Message}", "OK");
            }   
    }
    }
}

```
