![]() |
VOOZH | about |
dotnet add package CaysnPrintServer --version 1.1.0-gd40aadc4f2
NuGet\Install-Package CaysnPrintServer -Version 1.1.0-gd40aadc4f2
<PackageReference Include="CaysnPrintServer" Version="1.1.0-gd40aadc4f2" />
<PackageVersion Include="CaysnPrintServer" Version="1.1.0-gd40aadc4f2" />Directory.Packages.props
<PackageReference Include="CaysnPrintServer" />Project file
paket add CaysnPrintServer --version 1.1.0-gd40aadc4f2
#r "nuget: CaysnPrintServer, 1.1.0-gd40aadc4f2"
#:package CaysnPrintServer@1.1.0-gd40aadc4f2
#addin nuget:?package=CaysnPrintServer&version=1.1.0-gd40aadc4f2&prereleaseInstall as a Cake Addin
#tool nuget:?package=CaysnPrintServer&version=1.1.0-gd40aadc4f2&prereleaseInstall as a Cake Tool
A reliable CAYSN thermal printer server for ASP.NET Core with job queuing, print confirmation, and real-time notifications.
DbContext — your EF Core context must implement ICaysnPrintDbContext:
public class AppDbContext : DbContext, ICaysnPrintDbContext
{
public DbSet<CaysnPrintJob> CaysnPrintJobs => Set<CaysnPrintJob>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyCaysnPrintJobConfiguration();
// Optional: add FK to your own Printer entity
modelBuilder.Entity<CaysnPrintJob>()
.HasOne<Printer>()
.WithMany()
.HasForeignKey(e => e.PrinterId)
.OnDelete(DeleteBehavior.Restrict);
}
}
Printer provider — implement IPrinterProvider to supply printer connection details:
public class MyPrinterProvider : IPrinterProvider
{
public Task<ICaysnPrinter?> GetPrinterAsync(int printerId, CancellationToken ct = default)
{
// Return your printer entity adapted to ICaysnPrinter
}
public Task<IReadOnlyList<ICaysnPrinter>> GetActivePrintersAsync(CancellationToken ct = default)
{
// Return all enabled printers
}
}
builder.Services.AddCaysnPrintService<AppDbContext, MyPrinterProvider>(options =>
{
options.MaxConcurrentJobs = 5;
options.PrintConfirmationTimeoutMs = 15000;
options.ApiPrefix = "/api/print";
options.HubPath = "/hubs/print";
// SQL Server uses local time; PostgreSQL uses UTC (default)
options.UseUtcTimestamps = false; // set to false for SQL Server
// Register ESC/POS templates
options.RegisterTemplate("receipt", (printer, data) =>
{
// Build ESC/POS byte array using ESCPOS_NET
});
});
var app = builder.Build();
app.UseCaysnPrintService(); // Adds middleware
app.MapCaysnPrintService(); // Maps REST + SignalR endpoints
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0-gd40aadc4f2 | 161 | 4/10/2026 |
| 1.0.5-g8b39ac119e | 240 | 1/30/2026 |
| 1.0.4-g9a370141e2 | 69 | 1/30/2026 |
| 1.0.3-g9a370141e2 | 64 | 1/30/2026 |
| 1.0.2-g0733037fb4 | 77 | 1/30/2026 |
| 1.0.1-g0733037fb4 | 70 | 1/30/2026 |
| 1.0.0-g0733037fb4 | 68 | 1/30/2026 |