View PDF files in ASP.NET Core
GemBox.PdfViewer is a customizable JavaScript UI component that enables you to easily display PDF files in your ASP.NET Core web applications with just a few lines of code. A large set of features like search, text selection, print, digital signing, saving, navigation, and custom theme support will add the look and feel of standalone PDF applications to your ASP.NET Core applications.
With the provided tag helpers, adding the PDF Viewer to the ASP.NET Core application is easy.
The following live demo demonstrates the GemBox PDF Viewer in action:
How to add the PDF Viewer to your ASP.NET Core application?
1. Install GemBox PDF Viewer
You can add GemBox.PdfViewer to your ASP.NET Core project from the NuGet via NuGet Package Manager or you can install it from the command line:
dotnet add package GemBox.PdfViewer
2. Configure the ASP.NET Core PDF Viewer component
To use ASP.NET Core Tag Helper from your Razor views, you need to import the tag helper in your _ViewImports.cshtml
file:
@addTagHelper *, GemBox.PdfViewer
After that, you can use the <gembox-pdfviewer>
tag in your Razor views:
<gembox-pdfviewer
style="width:600px;height:350px;"
license-key="FREE-LIMITED-KEY"
initial-document="/document.pdf">
</gembox-pdfviewer>
The tag will automatically include the GemBox.PdfViewer assets from the CDN.
3. Alternative ways to use the ASP.NET Core PDF Viewer
If you prefer deploying GemBox.Pdf Viewer source files on your server, initializing and configuring GemBox.Pdf from JavaScript, you can find how to do that here.
What next?
GemBox PDF Viewer will allow your users to read existing PDF files from your ASP.NET Core applications. Check the other examples for more information about GemBox.PdfViewer's rich set of features and customizations that will allow you to tailor the PDF viewer to your specific requirements.
Also, we invite you to check our portfolio of C# file format components which could help open a path to future expansion of your applications and services.