SoftwareDriven.PdfJs.Blazor
1.3.0
dotnet add package SoftwareDriven.PdfJs.Blazor --version 1.3.0
NuGet\Install-Package SoftwareDriven.PdfJs.Blazor -Version 1.3.0
<PackageReference Include="SoftwareDriven.PdfJs.Blazor" Version="1.3.0" />
paket add SoftwareDriven.PdfJs.Blazor --version 1.3.0
#r "nuget: SoftwareDriven.PdfJs.Blazor, 1.3.0"
// Install SoftwareDriven.PdfJs.Blazor as a Cake Addin #addin nuget:?package=SoftwareDriven.PdfJs.Blazor&version=1.3.0 // Install SoftwareDriven.PdfJs.Blazor as a Cake Tool #tool nuget:?package=SoftwareDriven.PdfJs.Blazor&version=1.3.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.
The Url property is tracked and will reload the new document when changed.
Includes Polyfills for Promise.withResolvers
Product | Versions 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. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.