ZPF.PDFViewer.Maui
10.0.0.5
dotnet add package ZPF.PDFViewer.Maui --version 10.0.0.5
NuGet\Install-Package ZPF.PDFViewer.Maui -Version 10.0.0.5
<PackageReference Include="ZPF.PDFViewer.Maui" Version="10.0.0.5" />
<PackageVersion Include="ZPF.PDFViewer.Maui" Version="10.0.0.5" />
<PackageReference Include="ZPF.PDFViewer.Maui" />
paket add ZPF.PDFViewer.Maui --version 10.0.0.5
#r "nuget: ZPF.PDFViewer.Maui, 10.0.0.5"
#:package ZPF.PDFViewer.Maui@10.0.0.5
#addin nuget:?package=ZPF.PDFViewer.Maui&version=10.0.0.5
#tool nuget:?package=ZPF.PDFViewer.Maui&version=10.0.0.5
02/02/2026 - Work in progress ...
We were unable to get CollectionView to scroll horizontally properly,
so we had to revert to a ScrollView. If anyone knows how to implement horizontal
scrolling on CollectionView, we would appreciate your assistance.
😉
PDFViewer
A simple Maui PDF viewer based on the nativ PDF libraries ...
based on ideas and code of vitalii-vov ( https://github.com/vitalii-vov/Maui.PDFView )
“Powered by native PDF engines. Wrapped in simplicity.”
| .NET MAUI | .NET 10 |
|---|
| Platform | Android | iOS | Mac | Windows |
|---|---|---|---|---|
| Supported (goal) | ✅ | ✅ | ✅ | ✅ |
| Progress | 90 % | 90 % | 90 % | 90 % |
MacCatalyst is not tested yet!
<div id="image-table"> <table > <tr> <td style="padding:10px"> <img src="Doc/ScreenShots/iOS01.png" alt="iOS" height="500" > </td> <td style="padding:10px"> <img src="Doc/ScreenShots/Android01.png" alt="Android" height="500" > </td> <td style="padding:10px"> <img src="Doc/ScreenShots/WinUI01.png" alt="WinUI" height="500" > </td> </tr> </table> </div>
Download
https://www.nuget.org/packages/ZPF.PDFViewer.Maui
Installation
Install-Package ZPF.PDFViewer.Maui
or
dotnet add package ZPF.PDFViewer.Maui
Installation
Install-Package ZPF.PDFViewer.Maui
Usage
Nothing to add to MauiProgram.
Simply add PdfViewer 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:ZPF.PDFViewer.Maui;assembly=PDFViewer.Maui">
<pdf:PDFViewer
IsToolbarVisible="True"
BackgroundColor="AntiqueWhite"
ToolbarColor="LightGray"
ClickOnPage="pdfViewer_ClickOnPage"
DoubleClickOnPage="pdfViewer_DoubleClickOnPage" />
</ContentPage>
Set PDF source in code-behind
Load PDF from file path
await pdfViewer.LoadPDF(fullPath);
Load PDF with password
await pdfViewer.LoadPDF(fullPath, password);
For Android, Passwords are only supported on: 'android' 35.0 and later.
Error handling
if (!await pdfViewer.LoadPDF(fullPath, password))
{
await DisplayAlertAsync("Oups ...", pdfViewer.LastMessage, "ok");
}
Helper classes implementing IPdfSource
The PDFViewer 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 file, an asset, or a URL.
To simplify working with these data sources, the component includes helper classes that implement the IPdfSource interface:
AssetPdfSourceFilePdfSourceHttpPdfSource
Load PDF from file path
await pdfViewer.LoadPDF(new FilePdfSource(), FullPath);
Load PDF from URL
await pdfViewer.LoadPDF(new HttpPdfSource(), "https://www.learningcontainer.com/wp-content/uploads/2019/09/sample-pdf-download-10-mb.pdf");
Load PDF from resource asset
await pdfViewer.LoadPDF(new AssetPdfSource(),"Example.Resources.PDF.pdf2.pdf");
See the example project to see the different sources in action.
You can also create your own implementation of the IPdfSource interface to address your specific needs.
Helper classe PDFToImageHelper
Methods to save PDF pages as images:
SaveFirstPageAsImageAsync(string pdfPath, string outputImagePath)SavePageAsImageAsync(string pdfPath, string outputImagePath, uint pageNumber = 0)
Example of using PDFToImageHelper
{
string tnFileName = System.IO.Path.GetTempFileName();
await PDFToImageHelper.SaveFirstPageAsImageAsync(pdfFilepath, tnFileName);
return tnFileName;
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. net10.0-ios26.0 is compatible. net10.0-maccatalyst26.0 is compatible. net10.0-windows10.0.19041 is compatible. |
-
net10.0-android36.0
- Microsoft.Maui.Controls (>= 10.0.30)
- ZPF_Basics (>= 2.1.1.17)
-
net10.0-ios26.0
- Microsoft.Maui.Controls (>= 10.0.30)
- ZPF_Basics (>= 2.1.1.17)
-
net10.0-maccatalyst26.0
- Microsoft.Maui.Controls (>= 10.0.30)
- ZPF_Basics (>= 2.1.1.17)
-
net10.0-windows10.0.19041
- Microsoft.Maui.Controls (>= 10.0.30)
- ZPF_Basics (>= 2.1.1.17)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
* Add methods: ScrollToFirstAsync, ScrollToAsync, ScrollToLastAsync
* Bugfix LoadPDF
* Bugfix PDFToImageHelper
* BackgroundColor & ToolbarColor