SoftwareDriven.PdfJs.Blazor 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SoftwareDriven.PdfJs.Blazor --version 1.2.0                
NuGet\Install-Package SoftwareDriven.PdfJs.Blazor -Version 1.2.0                
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="SoftwareDriven.PdfJs.Blazor" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SoftwareDriven.PdfJs.Blazor --version 1.2.0                
#r "nuget: SoftwareDriven.PdfJs.Blazor, 1.2.0"                
#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 SoftwareDriven.PdfJs.Blazor as a Cake Addin
#addin nuget:?package=SoftwareDriven.PdfJs.Blazor&version=1.2.0

// Install SoftwareDriven.PdfJs.Blazor as a Cake Tool
#tool nuget:?package=SoftwareDriven.PdfJs.Blazor&version=1.2.0                

SoftwareDriven.PdfJs.Blazor is a wrapper for Mozilla PDF.js (refer to https://mozilla.github.io/pdf.js/) including a viewer with page navigation, rotation, zoom and find. The viewer also supports print on all browsers and devices. The JS code is an adopted mixture of the PDF.js examples enriched with JS to Blazor interop.

The viewer as well as the hidden print view are placed in iFrames to break out of the mandatory absolute positioning of PDF.js containers. You may set "BackgroundColor", "Style" (any style other than background-color) as well as a CSS class for the visible viewer frame.

Printing support needs to load the document for a second time and can be disabled using the "SupportPrint" property to reduce traffic overhead.

Set the "URL" property for the PDF source. It supports all kinds of URL (also base64).

During load, state change events are fired ("StateChanged").

On first load and when the page changed, an event is fired ("DocumentChanged").

When the scale changed, an event is fired ("ScaleChanged").

Before print, page load events are fired ("PreparePrint").

Create a reference to the viewer to access the following functions:

  • FirstPage()
  • LastPage()
  • PreviousPage()
  • NextPage()
  • RotateLeft()
  • RotateRight()
  • ZoomToScale(double scale)
  • ZoomTo(Zoom zoom)
  • Print()
  • Find(string query)
  • Download(string fileName, string shareTitle, string shareText)

Download automatically switches to sharing on any device other than Windows or Linux.

Includes Polyfills for Promise.withResolvers

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
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.3.0 256 8/8/2024
1.2.0 125 8/8/2024
1.1.0 98 8/7/2024
1.0.0 85 8/4/2024