PdfJSViewer-MAUI 1.0.1

dotnet add package PdfJSViewer-MAUI --version 1.0.1                
NuGet\Install-Package PdfJSViewer-MAUI -Version 1.0.1                
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="PdfJSViewer-MAUI" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PdfJSViewer-MAUI --version 1.0.1                
#r "nuget: PdfJSViewer-MAUI, 1.0.1"                
#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.
// Install PdfJSViewer-MAUI as a Cake Addin
#addin nuget:?package=PdfJSViewer-MAUI&version=1.0.1

// Install PdfJSViewer-MAUI as a Cake Tool
#tool nuget:?package=PdfJSViewer-MAUI&version=1.0.1                

MauiPdfJSViewer

NuGet version (PdfJSViewer-MAUI)

A implementation of pdfjs for android wrapped into a nuget so you can just install and use it. Have fun 😃.

Based on https://github.com/jfversluis/MauiPdfJsViewerSample

Be sure to meet pdf.js Apache license details in your app https://github.com/mozilla/pdf.js

Recording 2024-05-22 155352

Usage: XAML

        <pdfjs:PdfJsWebView x:Name="pdfJsViewer" />

C#

        private void Button_Clicked_FromAssets(object sender, EventArgs e)
        {
            pdfJsViewer.LoadPdfFromMauiAssets("sample.pdf");
        }

        private async void Button_Clicked_FromStream(object sender, EventArgs e)
        {
            using var stream = await FileSystem.OpenAppPackageFileAsync("sample.pdf");
            pdfJsViewer.LoadPdfFromSteam(stream);

        }

        private async void Button_Clicked_FromPath(object sender, EventArgs e)
        {
            string fileName = $"{Guid.NewGuid():N}.pdf";

            string filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), fileName);

            using var pdfStream = await FileSystem.OpenAppPackageFileAsync("sample.pdf");
            using (FileStream file = new FileStream(filePath, FileMode.Create, FileAccess.Write))
                pdfStream.CopyTo(file);

            pdfJsViewer.LoadPdfFromPath(filePath);
        }
Product Compatible and additional computed target framework versions.
.NET net8.0-android34.0 is compatible.  net8.0-ios17.2 is compatible.  net8.0-maccatalyst17.2 is compatible.  net8.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
1.0.1 371 7/8/2024
1.0.0 435 5/22/2024