dart_pdf
dart_pdf copied to clipboard
layoutPdf() does not return when printing is canceled on ChromeOS
Describe the bug I'm using Printing 5.6.0 and I'm calling layoutPdf like this:
setState(() => _printInProgress = true);
try {
await Printing.layoutPdf(onLayout: (format) async => _pdfData);
} finally {
setState(() => _printInProgress = false);
}
The future from layoutPdf does not return if I cancel the print preview on ChromeOS. so "_printInProgress" is true forever.
To Reproduce See code example above.
Expected behavior I expect the layoutPdf to return (false) when the printing is cancelled.
Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19041.1387], locale sv-SE)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.62.3)
[√] Connected device (3 available)
• No issues found!
Chromebook (please complete the following information):
- Device: Acer Chromebook (not sure on exact model)
- OS: ChromeOS 97
- App from Play Store (not web)
this is the same for me,
final printDone = await Printing.layoutPdf(
format: PdfPageFormat.a6,
usePrinterSettings: true,
onLayout: (_) => buffer,
);
print(printDone);
same issue showing on chrome and edge
Any updates on this issue?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Closing this stale issue because it has no activity.