Print-in-Blazor
[删除(380066935@qq.com或微信通知)]
更好的阅读体验请查看原文:https://github.com/Vikas8881/Print-in-Blazor
Blazor Printing
Print and Save files in Blazor using the native dialog box using JavaScript Interop and PrintJS.
The result
The blogpost
You can read more about the service in this blog post.
Documentation
Documentation and examples can be found here
Installing
You can install from NuGet using the following command:
Install-Package Append.Blazor.Printing
Setup
- Inject the
IPrintingService
inprogram.cs
builder.Services.AddScoped<IPrintingService, PrintingService>();
- Use the Service
@using Append.Blazor.Printing
@inject IPrintingService PrintingService
<button @onclick="@(()=> PrintingService.Print("docs/sample.pdf"))">
Print PDF
</button>