Migration from PDF Viewer to PDF Viewer (NextGen)
22 Jun 20235 minutes to read
Why PDF Viewer to PDF Viewer (NextGen) control
The migration to the PDF Viewer (NextGen) control brings a host of benefits, including improved performance in scrolling, pagination, and printing. These enhancements result in a smoother and more efficient user experience. Additionally, this migration eliminates the need for a Web assembly service dependency, streamlining the system and enhancing maintainability.
-
Enhanced Performance:
With the PDF Viewer (NextGen) control, users can expect significant improvements in performance. Scrolling through documents, navigating pages, and printing operations are now optimized for efficiency. Users will experience seamless and fluid interactions, ensuring a more productive and satisfying workflow. -
Elimination of Web Assembly Service Dependency:
The migration to the PDF Viewer (NextGen) control removes the requirement for a Web assembly service dependency. -
Unified Package for Multiple Platforms:
The PDF Viewer (NextGen) control is now available as a unified package for Windows, Mac, and Linux platforms. This means that regardless of their operating system, users can effortlessly install and utilize the package.
Nuget Package
To initialize the PDF Viewer (NextGen) component, need to add the following project references to your .csproj file
PDF Viewer |
---|
|
PDF Viewer (NextGen) |
|
Script File
To utilize the PDF Viewer (NextGen) component in your project, need to add the corresponding script file to the Host.cshtml or Layout.cshtml file based on your framework version.
NOTE
The script file is same for
Server application
andWeb assembly application
for PDF Viewer (NextGen) component
PDF Viewer |
---|
|
PDF Viewer (NextGen) |
|
Program.cs
Add the following line to the Program.cs file to use the PDF Viewer (NextGen) component
PDF Viewer |
---|
|
PDF Viewer (NextGen) |
|
Index.razor
To render the PDF Viewer (NextGen) component, add the following code in the Index.razor file.
PDF Viewer |
---|
|
PDF Viewer (NextGen) |
|
Project.cs
When using the PDF Viewer (NextGen) in a WebAssembly application, need to include the following lines in your .csproj file to ensure proper functionality and compatibility
PDF Viewer(NextGen) |
---|
|
NOTE
If you are WebAssembly application install SkiaSharp.NativeAssets.WebAssembly NuGet package.
NOTE
If you encounter issues while attempting to host the application in certain environments, such as Azure app services, install SkiaSharp.Views.Blazor instead of SkiaSharp.NativeAssets.WebAssembly Nuget package.