fix macos pdf

This commit is contained in:
2026-05-16 14:30:23 +02:00
parent 9a5d0e33bd
commit b3f463b688
10 changed files with 49 additions and 57 deletions

View File

@@ -213,8 +213,12 @@ class _TicketFormScreenState extends State<TicketFormScreen> {
.generateTicketReceipt(ticket);
final bytes = await doc.save();
final fileName = 'Ricevuta_${ticket.referenceId}.pdf';
await Printing.layoutPdf(
onLayout: (format) async => bytes,
name: fileName,
);
if (kIsWeb || Platform.isMacOS) {
/* if (kIsWeb || Platform.isMacOS) {
// Forza il download/salvataggio senza passare per il print spooler
await Printing.sharePdf(
bytes: bytes,
@@ -222,11 +226,8 @@ class _TicketFormScreenState extends State<TicketFormScreen> {
);
} else {
// Su Android/iOS continuiamo a usare la stampa diretta che funziona
await Printing.layoutPdf(
onLayout: (format) async => bytes,
name: fileName,
);
}
} */
},
),
if (company.labelFormat != LabelFormat.none)