---
title: "Open PDF from Base64 data in MAUI | Nutrient"
canonical_url: "https://www.nutrient.io/guides/maui/open-a-document/from-base64-data/"
md_url: "https://www.nutrient.io/guides/maui/open-a-document/from-base64-data.md"
last_updated: "2026-05-23T00:08:18.135Z"
description: "Nutrient MAUI SDK supports opening a document from a number of formats, including Base64 strings."
---

# Open a PDF from Base64 data in MAUI

Nutrient MAUI SDK supports opening a document from a number of formats, including Base64 strings.

## 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 a Base64 string

The following example code demonstrates how to open a document from a Base64 string:

```csharp

string documentAsBase64String = /* document read as base64 string */;
try
{
    var document = await PSPDFKitController.LoadDocumentFromBase64StringAsync(
        documentAsBase64String, PSPDFKitController.CreateViewerConfiguration());
}
catch (Exception ex)
{
    // Handle exception.
}

```

### Trying it out in Catalog

If you don’t have a Base64 string handy and you want to quickly try out loading a document from a Base64 string, you can use [this site](https://www.base64encode.net/pdf-to-base64) to convert a document to a Base64 string and then try loading a document in our Catalog app.
---

## Related pages

- [Open a PDF document from application assets in MAUI](/guides/maui/open-a-document/from-app-assets.md)
- [Open a PDF from an array buffer in MAUI](/guides/maui/open-a-document/from-arraybuffer.md)
- [Open a PDF from local storage in MAUI](/guides/maui/open-a-document/from-local-storage.md)
- [Open a PDF from a remote URL in MAUI](/guides/maui/open-a-document/from-remote-url.md)
- [Open a PDF document in MAUI](/guides/maui/open-a-document.md)

