---
title: "Open PDF from remote URL in MAUI | Nutrient"
canonical_url: "https://www.nutrient.io/guides/maui/open-a-document/from-remote-url/"
md_url: "https://www.nutrient.io/guides/maui/open-a-document/from-remote-url.md"
last_updated: "2026-05-15T19:10:05.048Z"
description: "In addition to loading documents directly from local storage using a file picker, from application assets, as an array buffer, or as a Base64 string."
---

# Open a PDF from a remote URL in MAUI

In addition to loading documents directly from [local storage](https://www.nutrient.io/guides/maui/open-a-document/from-local-storage.md) using a file picker, from [application assets](https://www.nutrient.io/guides/maui/open-a-document/from-app-assets.md), as an [array buffer](https://www.nutrient.io/guides/maui/open-a-document/from-arraybuffer.md), or as a [Base64 string](https://www.nutrient.io/guides/maui/open-a-document/from-base64-data.md), Nutrient MAUI SDK includes support for opening documents from remote sources. If you have a remote server, this guide will show you how to seamlessly load documents from it.

## 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 remote source

The following example code demonstrates how to load a document from a remote URL:

```csharp

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

```

If you experience issues loading a document from a remote URL, ensure the PDF file is accessible by checking the URL validity, network connectivity, and authentication requirements. If the issue persists, contact Support.

### Document with authentication

If a document is encrypted, use [`HTTPClient`](https://learn.microsoft.com/en-us/dotnet/maui/data-cloud/rest#create-the-httpclient-object) to [fetch the document](https://learn.microsoft.com/en-us/dotnet/maui/data-cloud/rest#retrieve-data) using the correct headers, and use the [`IController.LoadDocumentFromBuffer`](https://www.nutrient.io/guides/maui/open-a-document/from-arraybuffer/) or [`IController.LoadDocumentFromBase64String`](https://www.nutrient.io/guides/maui/open-a-document/from-base64-data/) method to load the document.

### Trying it out in Catalog

1. [Download and install npm] and the npm [`serve`](https://www.npmjs.com/package/serve) package.

2. Start a local server using `serve folder_path --cors`, where the folder path is the path to the folder containing the document.

3. In the Catalog app, select the **Load Document** example in the sidebar.

4. Select **Remote URL** as the document source.

5. In the text box, enter the URL of the document you want to load and press **Load**.
---

## 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 Base64 data in MAUI](/guides/maui/open-a-document/from-base64-data.md)
- [Open a PDF document in MAUI](/guides/maui/open-a-document.md)
- [Open a PDF from local storage in MAUI](/guides/maui/open-a-document/from-local-storage.md)

