feat(20-windows-client): aplikacja C# WinForms do zdalnego druku etykiet

- System tray app z NotifyIcon + ContextMenuStrip
- Polling API orderPRO (GET /api/print/jobs/pending)
- Pobieranie etykiet PDF i druk przez PdfiumViewer
- Formularz ustawień: URL API, klucz, drukarka, interwał
- Okno logów z historią (ciemny motyw, Consolas)
- Self-contained .NET 8 publish (win-x64)
- Milestone v0.7 Zdalne drukowanie etykiet — COMPLETE

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 22:49:28 +01:00
parent 02d06298ea
commit 5fef42ba12
1003 changed files with 5928 additions and 24 deletions

View File

@@ -0,0 +1,32 @@
using System.Drawing.Printing;
using PdfiumViewer;
namespace OrderPROPrint.Services;
public class PrintService
{
public bool PrintPdf(byte[] pdfBytes, string printerName)
{
using var stream = new MemoryStream(pdfBytes);
using var pdfDocument = PdfDocument.Load(stream);
using var printDocument = pdfDocument.CreatePrintDocument();
printDocument.PrinterSettings.PrinterName = printerName;
printDocument.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0);
// A6 = 105x148mm = 413x583 hundredths of inch
printDocument.DefaultPageSettings.PaperSize = new PaperSize("A6", 413, 583);
printDocument.PrintController = new StandardPrintController();
try
{
printDocument.Print();
return true;
}
catch
{
return false;
}
}
}