Skip to content

tgothorp/Gotho.BlazorPdf

Repository files navigation

Blazor PDF

MudPDF

Originally a port of the BlazorBootstrap PDF viewer for the MudBlazor component library. Blazor PDF is a simple yet powerful PDF viewer for the Blazor framework.

NuGet Version NuGet Downloads GitHub License

Are you using BlazorPDF in your project? Let me know!

Contents

Installation

Grab the package from nuget.org;

dotnet add package Gotho.BlazorPdf

Configuration

Add the following to your application startup in Program.cs;

builder.Services.AddBlazorPdfViewer();

Update your App.razor file to import the required CSS;

<link href="_content/Gotho.BlazorPdf/blazorpdf.min.css" rel="stylesheet"/>

Then, add the namespace to your _Imports.razor file;

@using Gotho.BlazorPdf

You should now be fully setup to use the PdfViewer component in your code!

Prerequisites

In order to use this package, your project must target .NET Version 8.0, or higher

Usage & Examples

Please see the documentation site for detailed examples

MudBlazor Integration

A dedicated MudBlazor-specific package is available for use.

This project was previously known as MudPdf / MudBlazor.PdfViewer. This repo was updated and renamed to remove the MudBlazor dependency such that the library can be used by any Blazor project.

However, in keeping with the original spirit of this project, a separate, dedicated package for MudBlazor is available.

See the documentation website for installation & usage details.

Contributing

Feel free to make contributions, see the CONTRIBUTING.md file for more information.

Icons

This project uses the excellent feather icons library.

License

Licensed under Apache-2.0

This library contains code from the PdfViewer Blazor component provided by the Blazor Bootstrap component library as well as code from Mozilla's pdf.js library.

Both are licensed under the Apache 2.0 license.

See NOTICE.md for more information.