dart_pdf icon indicating copy to clipboard operation
dart_pdf copied to clipboard

layoutPdf() does not return when printing is canceled on ChromeOS

Open mikeesouth opened this issue 3 years ago • 2 comments

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)

mikeesouth avatar Dec 06 '21 13:12 mikeesouth

this is the same for me,

final printDone = await Printing.layoutPdf(
  format: PdfPageFormat.a6,
  usePrinterSettings: true,
  onLayout: (_) => buffer,
);
print(printDone);

image

same issue showing on chrome and edge

orcecso avatar Jun 14 '22 15:06 orcecso

Any updates on this issue?

orcecso avatar Jun 28 '22 08:06 orcecso

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

github-actions[bot] avatar Apr 28 '23 00:04 github-actions[bot]

Closing this stale issue because it has no activity.

github-actions[bot] avatar May 04 '23 00:05 github-actions[bot]