Airprint - background printing produces blanks pages

When using iOS 16, when a pdf or image is printed from our app without interaction using UIPrintInteractionController.SharedPrintController and PrintToPrinterAsync(), the first item printed prints successfully but each successive print just prints out blank pages, even when printing the same pdf or image.

This continues until the app is restarted. Once restarted, the first item will print correctly again but everything after will print blank pages.

If a pdf or image is printed via the print UI with PresentAsync() or PresentFromRectInViewAsync(), the item will print properly each time.

It seems there is some problem with PrintToPrinterAsync on iOS 16 and/or xcode 14 (tested with xcode 14.1).

Another thread from other application indicates that this is a bug in the IOS 16 or later: https://github.com/expo/expo/issues/19275

Running into the same problem with pretty simple code. I tried:

  • Rewriting the async printing in ObjC and Swift, same problems.
  • Switching the printItem between a WKWebView and a UIImage, same problems.
  • Overriding the delegation of UIPrintPaper with a custom subclass of hardcoded paperSize and printableRect, same problems.
  • Using a new UIPrinter and UIPrintInteractionController every print job, same problem.

Nothing seems to resolve this issue. Has anyone been able to reproduce and resolve this issue?

Also, see this discussion happening with related outcomes: https://github.com/expo/expo/issues/19399

It appears someone has opened rdar://FB11966380 https://openradar.appspot.com/radar?id=5548908621070336

Airprint - background printing produces blanks pages
 
 
Q