MudBlazor Integration
A dedicated package is provided in order to provide a more seamless integration with MudBlazor
The package provides a dedicated MudPdfViewer
component that wraps the
default Blazor PDF Viewer functionality and provides a viewer build out of MudBlazor specific
components.
This allows for a much tighter integration with your MudBlazor project theme as well as the ability to customise the PDF Viewer with MudBlazor icons and colours.
<MudPdfViewer Url="https://raw.githubusercontent.com/tgothorp/MudBlazor.PdfViewer/refs/heads/main/files/test_pdf_document.pdf"/>
Installation
Grab the latest package from nuget.org
dotnet add package Gotho.BlazorPdf.MudBlazor
Configuration
Add the following to your application startup in Program.cs
builder.Services.AddMudBlazorPdfViewer();
Update your App.razor
file to import the required CSS.
<link href="_content/Gotho.BlazorPdf.MudBlazor/blazorpdf_mudblazor.min.css" rel="stylesheet"/>
Then, add the namespace to your _Imports.razor
file.
@using Gotho.BlazorPdf.MudBlazor;
You should now be able to use Blazor PDF in your Project! 🚀
Usage
Below is a basic example of the minimum required code in order to display a PDF document. See the rest of the documentation for full configuration options.
<MudPdfViewer Url="https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf"/>