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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZPF.PDFViewer.Maui" Version="10.0.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZPF.PDFViewer.Maui" Version="10.0.0.5" />
                    
Directory.Packages.props
<PackageReference Include="ZPF.PDFViewer.Maui" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZPF.PDFViewer.Maui --version 10.0.0.5
                    
#r "nuget: ZPF.PDFViewer.Maui, 10.0.0.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZPF.PDFViewer.Maui@10.0.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZPF.PDFViewer.Maui&version=10.0.0.5
                    
Install as a Cake Addin
#tool nuget:?package=ZPF.PDFViewer.Maui&version=10.0.0.5
                    
Install as a Cake Tool

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!

NuGet Downloads   NuGet Downloads   GitHub License   last commit


<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:

  • AssetPdfSource
  • FilePdfSource
  • HttpPdfSource

 

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;
   }

 

Experimental doc...

 

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
10.0.0.5 88 2/2/2026
10.0.0.4 90 1/30/2026
10.0.0.3 90 1/27/2026
10.0.0.2 109 1/26/2026

* Add methods: ScrollToFirstAsync, ScrollToAsync, ScrollToLastAsync
* Bugfix LoadPDF
* Bugfix PDFToImageHelper
* BackgroundColor & ToolbarColor