|
1 | 1 | ---
|
2 | 2 | layout: post
|
3 |
| -title: Deploy SfPdfViewer in Blazor MAUI in Android | Syncfusion |
4 |
| -description: Learn how to deploy SfPdfViewer in Blazor MAUI Application on Android in Syncfusion Blazor SfPdfViewer component and much more details. |
| 3 | +title: Deploy SfPdfViewer in Blazor MAUI on Android | Syncfusion |
| 4 | +description: Learn how to render a PDF from an embedded resource and run the Syncfusion Blazor SfPdfViewer on Android using the .NET MAUI emulator. |
5 | 5 | platform: document-processing
|
6 | 6 | control: SfPdfViewer
|
7 | 7 | documentation: ug
|
8 | 8 | ---
|
9 | 9 |
|
10 |
| -# Render PDF document from embedded source in the MAUI Android app |
| 10 | +# Render a PDF from an embedded resource in a MAUI Android app |
11 | 11 |
|
12 |
| -In this section, we'll guide you how to render PDF Viewer from embedded source in a MAUI app. We'll break it down into simple steps to make it easy to follow. |
| 12 | +This section describes how to render the PDF Viewer from an embedded resource in a .NET MAUI Android app using the Android emulator. |
13 | 13 |
|
14 |
| -Refer [here](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/blazor/getting-started/deploy-maui-windows) to create MAUI app. |
| 14 | +To create the .NET MAUI project, see Create a [MAUI app](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/blazor/getting-started/deploy-maui-windows) |
15 | 15 |
|
16 |
| -## Add PDF Viewer component |
| 16 | +## Add the PDF Viewer component |
17 | 17 |
|
18 |
| -Add the Syncfusion<sup style="font-size:70%">®</sup> PDF Viewer (Next Gen) component in the **~/Pages/Index.razor** file. |
| 18 | +Add the Syncfusion Blazor PDF Viewer component in the **~/Pages/Index.razor** file. |
19 | 19 |
|
20 | 20 | {% tabs %}
|
21 | 21 | {% highlight razor %}
|
@@ -45,41 +45,42 @@ Add the Syncfusion<sup style="font-size:70%">®</sup> PDF Viewer (Next Gen) c
|
45 | 45 | base.OnInitialized();
|
46 | 46 | }
|
47 | 47 | }
|
| 48 | + |
48 | 49 | {% endhighlight %}
|
49 | 50 | {% endtabs %}
|
50 | 51 |
|
51 |
| -N> When developing a Blazor Android MAUI application, passing the [DocumentPath](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_DocumentPath) to the PDF Viewer component as a `base64 string` is needed. This ensures that the application can retrieve and render a PDF document correctly within the PDF Viewer component. |
| 52 | +N> In a Blazor .NET MAUI Android app, pass the [DocumentPath](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_DocumentPath) as a Base64 data URL. This ensures the viewer can retrieve and render the PDF correctly. |
52 | 53 |
|
53 |
| -## Run on Android emulator |
| 54 | +## Run on the Android emulator |
54 | 55 |
|
55 |
| -To run the PDF Viewer in a Blazor Android MAUI application using the Android emulator, follow these steps: |
| 56 | +To run the PDF Viewer in a Blazor .NET MAUI Android app using the Android emulator, follow these steps: |
56 | 57 |
|
57 |
| - |
| 58 | + |
58 | 59 |
|
59 |
| -**Step 1** Set up the necessary dependencies, SDKs, and tools for Blazor Android MAUI on your Windows machine. Ensure that you have installed the required `Android SDK licenses`. If any errors occur during installation, follow the provided prompts or instructions to resolve them. |
| 60 | +**Step 1** Install the required dependencies, SDKs, and tools for .NET MAUI Android on Windows. Ensure the Android SDK licenses are accepted. If errors occur during installation, follow the prompts to resolve them. |
60 | 61 |
|
61 |
| - |
| 62 | + |
62 | 63 |
|
63 |
| -**Step 2** Right-click the **~wwwroot/data/pdf_succinctly.pdf** file in Solution Explorer, go to `Properties`, and set Build Action to `Embedded Resource` and Copy to Output Directory to `Copy Always`. |
| 64 | +**Step 2** In Solution Explorer, right-click **~wwwroot/data/pdf_succinctly.pdf**, choose `Properties`, set Build Action to `Embedded Resource`, and set Copy to Output Directory to `Copy always`. |
64 | 65 |
|
65 |
| - |
| 66 | + |
66 | 67 |
|
67 |
| -**Step 3** Install and launch the Android Device Manager. Open the Android SDK Manager, go to the `SDK Tools` tab, select the `Android Device Manager` checkbox, and click `Apply` or `OK`. This will allow you to create, manage, and launch Android Virtual Devices (AVD's) for testing and running Android applications. |
| 68 | +**Step 3** Install and launch Android Device Manager. In Android SDK Manager, on the `SDK Tools` tab, select `Android Device Manager` and click `Apply` or `OK`. This enables creating and managing Android Virtual Devices (AVD) for testing. |
68 | 69 |
|
69 |
| - |
| 70 | + |
70 | 71 |
|
71 |
| -**Step 4** Ensure the Android emulator is running. Launch the Android Device Manager and create or select an existing AVD to run the emulator. |
| 72 | +**Step 4** Ensure the Android emulator is running. In Android Device Manager, create or select an AVD and start the emulator. |
72 | 73 |
|
73 |
| -Now, relaunch the project in emulator mode. It will render the PDF Viewer component using the Blazor Android MAUI application. |
| 74 | +Finally, run the project with the emulator. The PDF Viewer component renders in the Blazor .NET MAUI Android app. |
74 | 75 |
|
75 |
| -N> If you encounter any errors while using the Android Emulator, refer to the following link for troubleshooting guidance[Troubleshooting Android Emulator](https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/troubleshooting). |
| 76 | +N> For emulator issues, see Troubleshooting Android Emulator: https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/troubleshooting |
76 | 77 |
|
77 |
| - |
| 78 | + |
78 | 79 |
|
79 |
| ->[View Sample in GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Server%20Deployment/Maui/MauiBlazorAndroid). |
| 80 | +>[View sample on GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Server%20Deployment/Maui/MauiBlazorAndroid). |
80 | 81 |
|
81 | 82 | ## See also
|
82 | 83 |
|
83 |
| -* [Supported Features: Desktop vs Mobile](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/blazor/overview#supported-features-desktop-vs-mobile). |
| 84 | +* [Supported features: Desktop vs mobile](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/blazor/overview#supported-features-desktop-vs-mobile). |
84 | 85 |
|
85 |
| -* [Render PDF document from url in the MAUI app](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/blazor/getting-started/deploy-maui-windows). |
| 86 | +* [Render a PDF document from a URL in the MAUI app](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/blazor/getting-started/deploy-maui-windows). |
0 commit comments