View PDF files in ASP.NET Core
GemBox.PdfViewer provides tag helpers, making it very simple to initialize the PDF Viewer in the ASP.NET Core application.
Installation
Before you can use GemBox.PdfViewer you need to install it in your project. You can either add GemBox.PdfViewer NuGet package via NuGet Package Manager in Visual Studio, or you can install it from the command line:
dotnet add package GemBox.PdfViewer
To use ASP.NET Core Tag Helper in 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 CDN. If you wish to host assets yourself, you can download and include the JavaScript and CSS files.
<script src="/pdfviewer.js"></script>
<script src="/pdfviewer.css"></script>
The tag will automatically detect and use the included assets.