Post not yet marked as solved
Cannot look at contents of file in Print Queue with Sonoma
Before Sonoma, after I selected print in a application, e.g., Word, I could double click on the document stored in the Print Queue and the pages would be displayed.
With Sonoma, cannot see file contents??
One last thing pertaining to this Print Queue =
I can't delete any of the accumulated "Completed" Jobs .. menu item to delete selected Jobs is dimmed??
Post not yet marked as solved
Code to print
self.airPrintWebView.loadHTMLString(html, baseURL: nil)
self.view.add(subView:self.airPrintWebView)
let formatter = self.airPrintWebView.viewPrintFormatter()
//1.5" margins for the page
formatter.perPageContentInsets = UIEdgeInsets(top: HALF_INCH_INSET, left: ONE_INCH_INSET, bottom: ONEHALF_INCH_INSET, right: ONE_INCH_INSET)
let activityVC = UIActivityViewController(activityItems: [formatter], applicationActivities: nil)
// Prevents iBook and PDF from being options
activityVC.excludedActivityTypes = [.openInIBooks, .markupAsPDF]
activityVC.completionWithItemsHandler = { (activity, success, items, error) in
self.airPrintWebView.removeFromSuperview()
if shouldRemoveSenderButton {
sender.removeFromSuperview()
}
PredictSpringApplication.sharedInstance.psAlertBlockView?.isHidden = false
}
if PSUtil.isIpad() {
activityVC.popoverPresentationController?.sourceView = self.airPrintWebView
activityVC.popoverPresentationController?.sourceRect = sender.frame
}
self.present(activityVC, animated: true, completion: nil)
Crash
Crashed: com.apple.main-thread
0 CoreGraphics 0x107e6c CGPDFDocumentIsEncrypted + 12
1 PrintKitUI 0x586b0 -[UIPrintPreviewPageFetcher redrawQuicklookPDF:] + 104
2 PrintKitUI 0x28f4c -[UIPrintPreviewViewController updateQuicklookPDF] + 148
3 Foundation 0xa6f14 NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 24
4 Foundation 0x7b020 -[NSBlockOperation main] + 104
5 Foundation 0x7afb0 NSOPERATION_IS_INVOKING_MAIN + 16
6 Foundation 0x3c4d8 -[NSOperation start] + 708
7 Foundation 0x3c20c NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION + 16
8 Foundation 0x4189c __NSOQSchedule_f + 172
9 libdispatch.dylib 0x12fc4 _dispatch_block_async_invoke2 + 148
10 libdispatch.dylib 0x3eac _dispatch_client_callout + 20
11 libdispatch.dylib 0x126a4 _dispatch_main_queue_drain + 928
12 libdispatch.dylib 0x122f4 _dispatch_main_queue_callback_4CF + 44
13 CoreFoundation 0x98c28 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16
14 CoreFoundation 0x7a560 __CFRunLoopRun + 1992
15 CoreFoundation 0x7f3ec CFRunLoopRunSpecific + 612
16 GraphicsServices 0x135c GSEventRunModal + 164
17 UIKitCore 0x39d6e8 -[UIApplication _run] + 888
18 UIKitCore 0x39d34c UIApplicationMain + 340
19 PSStore 0xbaa0 main + 2 (main.swift:2)
20 ??? 0x1b94fedec (Missing)
Any body able to solve this random crash ?
Post not yet marked as solved
I want to use the AirPrint API, which is a standard OS printing function, programmatically on an iOS application to print directly to a printer by specifying single-sided printing instead of double-sided printing for the first print after the OS is initialised.
〇Verification environment
・Device: iPad 9 generation
・OS:OS16.6
・Printer model: EPSON PX-S730 / Brother MFC-J7300CDW / Canon G5030 / EPSON PX-M791FT
※All printers used for verification support AirPrint and are capable of duplex printing.
〇Issue
The duplex printing option can be specified from the program using the AirPrint API property "duplex",
However, when printing is executed from the program, the specified print option "duplex printing" is not reflected in the AirPrint API.
〇Verification results
Installed the developed print verification app on the device in factory default state, and executed the print process from the app to the printer.
(1st time) Set the property "duplex printing" = duplex or single-sided in the AirPrint API of iOS → In both cases, printing was performed on both sides.
(2nd and subsequent times) Set the property "duplex printing" = duplex or single-sided in the AirPrint API of iOS → In both cases, printing is done on one side.
〇Source Code
The print verification application we developed uses the UIPrintInteractionController class in Swift to specify the printing options for duplex printing.
We believe we can specify this by setting "info.duplex = UIPrintInfo.Duplex.none" in the following source code and adding it to printInfo.
func buttonClick(_ sender: Any) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary: nil)
printInfo.jobName = "PrintJob from PrintTestApp"
// color
printInfo.outputType = UIPrintInfo.OutputType.general
// duplex mode for the print
printInfo.duplex = UIPrintInfo.Duplex.none // set the single side option
printController.printInfo = printInfo
// PDF printing in project folder
printController.printingItem = Bundle.main.url(forResource: "sample", withExtension: "pdf")!
// printer settings
let printer = UIPrinter(url: URL(string: "ipps://XXXXXXX/ipp/print")!)
// direct printing
printController.print(to: printer, completionHandler: {
controller, completed, error in
guard error == nil else {
return
}
})
}
Post not yet marked as solved
Watchdog killed the app because PrintKit is performing XPC operations on the main thread,see the call stacks below.
__dispatch_sema4_timedwait
__dispatch_semaphore_wait_slow
+[_PK_OneShotXPC withTimeout:doSyncronousOneShot:]
__pk_mdns_resolveSynchronous
-[PKPrinter(PKPrinterPrivate) resolveWithTimeout:]
-[PKPrinter printerURL]
-[UIPrinter _initWithPrinter:]
-[UIPrinterSelectionOption setPrinter:]
-[UIPrinterBrowserViewController tableView:didSelectRowAtIndexPath:]
-[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:deselectPrevious:performCustomSelectionAction:]
-[UITableView _userSelectRowAtPendingSelectionIndexPath:]
-[_UIAfterCACommitBlock run]
-[_UIAfterCACommitQueue flush]
__runAfterCACommitDeferredBlocks
__cleanUpAfterCAFlushAndRunDeferredBlocks
__UIApplicationFlushCATransaction
__UIUpdateSequenceRun
_schedulerStepScheduledMainSection
_runloopSourceCallback
___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
___CFRunLoopDoSource0
___CFRunLoopDoSources0
___CFRunLoopRun
_CFRunLoopRunSpecific
_GSEventRunModal
-[UIApplication _run]
_UIApplicationMain
main main.m:26
start
Post not yet marked as solved
I'm using UIPrintInteractionController(AirPrint) to print documents in my swift application. I was able to print the documents using my application, but all of them are printing in one-sided. Now i want to add a double-sided printing as an option to my application. After some research i found that it can be implement by adding info.duplex = UIPrintInfo.Duplex.longEdge to printInfo.
I tried it using the below code.
private var printController = UIPrintInteractionController.shared
let info = UIPrintInfo.printInfo()
info.duplex = UIPrintInfo.Duplex.longEdge <<<<<<
info.jobName = "XXXPrint"
info.orientation = .portrait
printController.printInfo = info
printController.print(to: printer, completionHandler: { [self]
controller, completed, error in
if(error != nil){
print("successfully")
}else{
print("Printing error: \(error.localizedDescription)")
}
}
But whether i set it in the code and run my application it is printing the pages by one-sided.
So if some one can guide me to double-sided printing workable solution highly appreciated!!
Post not yet marked as solved
My app is crashing intermittently when showing the printer options to print html data.
I am unable to reproduce this crash however here is the stack trace from crash logs
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x9e88 __exceptionPreprocess
1 libobjc.A.dylib 0x178d8 objc_exception_throw
2 Foundation 0x545b4c _userInfoForFileAndLine
3 UIKitCore 0x14bc40 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:]
4 UIKitCore 0x21a330 -[UITableView _createPreparedCellForRowAtIndexPath:willDisplay:]
5 UIKitCore 0x219f18 -[UITableView _heightForRowAtIndexPath:]
6 UIKitCore 0x219db4 -[UISectionRowData heightForRow:inSection:canGuess:]
7 UIKitCore 0x44cf98 -[UITableViewRowData heightForRow:inSection:canGuess:adjustForReorderedRow:]
8 UIKitCore 0x5a0ec -[UITableViewRowData rectForRow:inSection:heightCanBeGuessed:]
9 UIKitCore 0x44c520 -[UITableViewRowData rectForGlobalRow:heightCanBeGuessed:]
10 UIKitCore 0x44db74 -[UITableViewRowData globalRowsInRect:canGuess:]
11 UIKitCore 0x480050 -[_UITableViewUpdateSupport _faultInRealHeightsOfNeededElements]
12 UIKitCore 0x4ba2dc -[_UITableViewUpdateSupport _setupAnimations]
13 UIKitCore 0x2efb58 -[UITableView _updateWithItems:updateSupport:]
14 UIKitCore 0x2b3500 -[UITableView _endCellAnimationsWithContext:]
15 UIKitCore 0x271ea4 -[UITableView _updateSections:withUpdateAction:rowAnimation:headerFooterOnly:usingPresentationValues:]
16 UIKitCore 0xe70084 -[UITableView _reloadSectionHeaderFooters:withRowAnimation:]
17 PrintKitUI 0x60468 -[UIPrintOptionsTableViewController hideGatheringPrinterInfo]
18 libdispatch.dylib 0x24b4 _dispatch_call_block_and_release
19 libdispatch.dylib 0x3fdc _dispatch_client_callout
20 libdispatch.dylib 0x127f4 _dispatch_main_queue_drain
21 libdispatch.dylib 0x12444 _dispatch_main_queue_callback_4CF
22 CoreFoundation 0x9a6f8 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
23 CoreFoundation 0x7c058 __CFRunLoopRun
24 CoreFoundation 0x80ed4 CFRunLoopRunSpecific
25 GraphicsServices 0x1368 GSEventRunModal
26 UIKitCore 0x3a23d0 -[UIApplication _run]
27 UIKitCore 0x3a2034 UIApplicationMain
28 PSStore 0xbaa0 main ()
29 ??? 0x1e567c960 (Missing)