DavBfr / dart_pdf

Pdf creation module for dart/flutter
https://pub.dev/packages/pdf
Apache License 2.0
1.39k stars 619 forks source link

Printing issue in Flutter Windows #1472

Open MimiKhan opened 1 year ago

MimiKhan commented 1 year ago

Issue Description Printing functionality in my Flutter Windows application is not working as expected in release mode. However, it works perfectly in debug mode. I have tried multiple approaches to troubleshoot the issue but haven't been successful in resolving it.

Environment

Problem Statement When attempting to print from my Flutter Windows application in release mode, the process fails, and no output is sent to the printer. This issue is specific to release mode, as printing works as expected in debug mode.

Steps to Reproduce

  1. Build and run the Flutter Windows application in release mode.
  2. Trigger a print operation from the app.
  3. Observe that the printing process fails.

Expected Behavior Printing should work seamlessly in both debug and release modes, providing output to the designated printer.

Additional Information

I'm seeking assistance in identifying the root cause of this issue and finding a solution to enable printing in release mode for my Flutter Windows application. Any guidance or insights into potential solutions would be greatly appreciated.

Thank you!

PMack101 commented 1 year ago

I have had the same issue with the package working in debug but not in release mode.

I have managed to get around the issue by commenting out lines 148 - 164 of 'widget_wrapper.dart', and then in line 174 changing 'computedConstraints.' to 'constraints.'.

image

MimiKhan commented 1 year ago

Ok Thanks. I'll try and let you know. Thanks for the help.

MimiKhan commented 1 year ago

I tried this but nothing's changed for me. Its still not printing. @PMack101

bksbora commented 12 months ago

Can you try to avoid spaces and some caracters like İ ( Turkish <3) for example :

PdfPreview(
          pdfFileName:
              '${customerModel.musteriAdiSoyadi!.replaceAll(RegExp(r' '), "-").toString()}