---
title: "Open PDF from ArrayBuffer in MAUI | Nutrient"
canonical_url: "https://www.nutrient.io/guides/maui/open-a-document/from-arraybuffer/"
md_url: "https://www.nutrient.io/guides/maui/open-a-document/from-arraybuffer.md"
last_updated: "2026-06-08T09:14:14.425Z"
description: "Nutrient MAUI SDK supports opening a document from a number of formats. Discover how to use an array buffer to display a document in PDFView."
---

# Open a PDF from an array buffer in MAUI

Nutrient MAUI SDK supports opening a document from a number of formats. This guide explains how to use an array buffer to display a document in [`PDFView`](https://www.nutrient.io/api/maui/sdk/PSPDFKit.Sdk.PDFView.html).

## Introduction

To open a document, you need to add [`PDFView`](https://www.nutrient.io/api/maui/sdk/PSPDFKit.Sdk.PDFView.html) to your desired XAML. You’ll also need to assign a `Name` for interacting with it through code. In this example, [`PDFView`](https://www.nutrient.io/api/maui/sdk/PSPDFKit.Sdk.PDFView.html) is named `PDFView`:

```csharp

<pspdfkit:PDFView x:Name="PDFView" Initialized="OnPDFViewInitialized"
                  License="{OnPlatform
                    Android={StaticResource AndroidLicenseKey},
                    iOS={StaticResource iOSLicenseKey},
                    MacCatalyst={StaticResource MacCatalystLicenseKey},
                    WinUI={StaticResource WindowsLicenseKey}}" />

```

The rest of the document opening process needs to be done after the [`PDFView`](https://www.nutrient.io/api/maui/sdk/PSPDFKit.Sdk.PDFView.html) [control](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/) is loaded. The easiest way to ensure it’s loaded is by using the [`PDFView.Initialized`](https://www.nutrient.io/api/maui/sdk/PSPDFKit.Sdk.PDFView.html#PSPDFKit_Sdk_PDFView_Initialized) event as shown above. Alternatively, you can subscribe to it in code-behind as follows:

```csharp

PDFView.Initialized += (sender, e) =>
{
    //...
};

```

If you don’t intend to open a document straight away and you know that [`PDFView`](https://www.nutrient.io/api/maui/sdk/PSPDFKit.Sdk.PDFView.html) will always be initialized, you can skip this step and open the document whenever it’s convenient.





## Opening a document from an array buffer

The following example code demonstrates how to open a document from a byte array:

```csharp

byte[] documentAsBuffer = /* document read as byte array */;

try
{
    var document = await PSPDFKitController.LoadDocumentFromBufferAsync(documentAsBuffer,
        PSPDFKitController.CreateViewerConfiguration());
}
catch (Exception ex)
{
    // Handle exception.
}

```
---

## Related pages

- [Open a PDF document from application assets in MAUI](/guides/maui/open-a-document/from-app-assets.md)
- [Open a PDF from Base64 data in MAUI](/guides/maui/open-a-document/from-base64-data.md)
- [Open a PDF from local storage in MAUI](/guides/maui/open-a-document/from-local-storage.md)
- [Open a PDF document in MAUI](/guides/maui/open-a-document.md)
- [Open a PDF from a remote URL in MAUI](/guides/maui/open-a-document/from-remote-url.md)

