DavBfr / dart_pdf

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

Printing not working in iOS #1468

Open imustafajamal opened 1 year ago

imustafajamal commented 1 year ago

Hi there thanks for this nice package I have problem while using this package in my flutter app in iOS version when I'm trying to print a Unit8List file using this line of code

await Printing.layoutPdf(onLayout: (_) => studentController.clearanceFile!.buffer.asUint8List());

I get this note in debug console

[VERBOSE-2:shell.cc(1004)] The 'net.nfet.printing' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel. See https://docs.flutter.dev/platform-integration/platform-channels#channels-and-platform-threading for more information.

and printing page not showing my pdf file it's just loading preview text and still loading as show in image below

Simulator Screenshot - iPhone 14 Pro Max - 2023-08-31 at 00 04 19

any help please!

fvisticot commented 1 year ago

same issue

emgore-jg commented 9 months ago

Same issue

Enki-work commented 9 months ago

I changed CocoaPods from static linking to dynamic linking and solved this problem. Is it because the 'printing' package does not support static linking? use_frameworks! :linkage => :staticuse_frameworks!

DavBfr commented 9 months ago

@Enki-work If there is something to change on the package, please create a PR.

diogoluzzardi commented 6 months ago

Hi, is there a solution for this. I'm also unable to print?

sambrucejoseph commented 3 months ago

I changed CocoaPods from static linking to dynamic linking and solved this problem. Is it because the 'printing' package does not support static linking? use_frameworks! :linkage => :staticuse_frameworks!

Thanks, I had the same issue and fixed it like how you said. 🙏