Vitvov.Maui.PDFView
1.8.4
dotnet add package Vitvov.Maui.PDFView --version 1.8.4
NuGet\Install-Package Vitvov.Maui.PDFView -Version 1.8.4
<PackageReference Include="Vitvov.Maui.PDFView" Version="1.8.4" />
<PackageVersion Include="Vitvov.Maui.PDFView" Version="1.8.4" />
<PackageReference Include="Vitvov.Maui.PDFView" />
paket add Vitvov.Maui.PDFView --version 1.8.4
#r "nuget: Vitvov.Maui.PDFView, 1.8.4"
#:package Vitvov.Maui.PDFView@1.8.4
#addin nuget:?package=Vitvov.Maui.PDFView&version=1.8.4
#tool nuget:?package=Vitvov.Maui.PDFView&version=1.8.4
<img src="icon.png" width="32" /> Maui.PDFView
Library for display PDF files in .NET MAUI on Android, iOS, MacOS and Windows
| Platform | Android | iOS | MacOS | Windows |
|---|---|---|---|---|
| Supported | ✅ | ✅ | ✅ | ✅ |
| .NET 9 | .NET 10 |
|---|---|
| 1.7.3 | 1.8.0+ |
https://github.com/vitalii-vov/Maui.PDFView/assets/71486507/4977ede8-c8db-454f-930d-ba2ec704f16d
<br>
Installation
Install-Package Vitvov.Maui.PDFView
<br>
Usage
Add .UseMauiPdfView() to MauiProgram
using Maui.PDFView;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiPdfView(); // <- Write this
return builder.Build();
}
}
<br>
Add PdfView to XAML
<ContentPage
x:Class="Example.Business.UI.Pages.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:pdf="clr-namespace:Maui.PDFView;assembly=Maui.PDFView">
<pdf:PdfView
IsHorizontal="{Binding IsHorizontal}"
Uri="{Binding PdfSource}"
MaxZoom="4"
PageIndex="{Binding PageInex}"
PageChangedCommand="{Binding PageChangedCommand}">
</pdf:PdfView>
</ContentPage>
<br>
Set PdfSource in ViewModel
internal partial class MainPageViewModel : ObservableObject
{
[ObservableProperty] private string? _pdfSource;
[RelayCommand] private void ChangeUri()
{
try
{
// See the example project to understand how to work with paths.
PdfSource = "/path/to/file.pdf";
// You can set the Uri property to null to clear the component.
//PdfSource = null;
}
catch(Exception ex)
{
// handle exceptions
}
}
}
<br>
Personalization
You can customize the way pages are displayed by modifying the PageAppearance property in the PdfView component.
<pdf:PdfView Uri="{Binding PdfSource}">
<pdf:PdfView.PageAppearance>
<pdf:PageAppearance
Margin="16,8"
ShadowEnabled="True"
Crop="64,32"/>
</pdf:PdfView.PageAppearance>
</pdf:PdfView>
<br>
Helper classes implementing IPdfSource
The PdfView component works only with file paths. This is because the native platform components primarily operate with file paths, and handling different PDF data sources directly inside the component would significantly complicate the code.
Therefore, you must always provide a file path regardless of the form your PDF data takes—whether it’s a byte array, a stream, an asset, or a URL.
To simplify working with these data sources, the component includes helper classes that implement the IPdfSource interface:
AssetPdfSourceByteArrayPdfSourceFilePdfSourceHttpPdfSource
Example of using PdfSource
[RelayCommand] private async Task UploadUri()
{
var source = new HttpPdfSource("https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf");
PdfSource = await source.GetFilePathAsync();
}
[RelayCommand] private async Task UploadAsset()
{
var source = new AssetPdfSource("Example.Resources.PDF.pdf2.pdf");
PdfSource = await source.GetFilePathAsync();
}
You can also create your own implementation of the IPdfSource interface to address your specific needs.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-ios26.0 is compatible. net10.0-maccatalyst was computed. net10.0-maccatalyst26.0 is compatible. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net10.0-windows10.0.19041 is compatible. |
-
net10.0
- Microsoft.Maui.Controls (>= 10.0.90)
-
net10.0-android36.0
- Microsoft.Maui.Controls (>= 10.0.90)
-
net10.0-ios26.0
- Microsoft.Maui.Controls (>= 10.0.90)
-
net10.0-maccatalyst26.0
- Microsoft.Maui.Controls (>= 10.0.90)
-
net10.0-windows10.0.19041
- Microsoft.Maui.Controls (>= 10.0.90)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.8.4 | 1,027 | 8/26/2026 |
| 1.8.3 | 404 | 8/8/2026 |
| 1.8.1 | 339 | 8/4/2026 |
| 1.8.0 | 3,196 | 5/25/2026 |
| 1.7.3 | 8,552 | 2/18/2026 |
| 1.7.2 | 1,676 | 1/21/2026 |
| 1.7.1-beta1 | 120 | 1/20/2026 |
| 1.6.0 | 3,871 | 11/7/2025 |
| 1.5.0 | 24,472 | 5/27/2025 |
| 1.4.0 | 272 | 5/25/2025 |
| 1.3.0 | 476 | 5/21/2025 |
| 1.2.2 | 2,283 | 4/19/2025 |
| 1.2.1 | 765 | 4/15/2025 |
| 1.2.0 | 1,028 | 3/14/2025 |
| 1.1.0 | 809 | 3/7/2025 |
| 1.0.6 | 22,988 | 10/7/2024 |
| 1.0.5 | 7,225 | 8/6/2024 |
| 1.0.4 | 4,202 | 6/27/2024 |
| 1.0.3 | 20,585 | 1/10/2024 |
| 1.0.2 | 345 | 12/28/2023 |