Ref- https://support.apple.com/en-in/guide/deployment/dep3b4cf515/web
When we deploy an Payload with identifier "com.apple.airprint" , It will add the deployed printer configurations to printers list in mac. Which additionally needs the mac user to add it from Settings -> Printers -> Add Printer -> (Deployed Printer Configuration will be listed here) Select the printer -> Click Add .
Screenshot where user need to add it manually after profile association is attached below.
Now the Printer is available to be used ,when an share option in any document is clicked.
Why this flow requires multiple to and fro. Can it be able to deploy the printer straight to Printers available List instead of manually adding from the above screenshot
AirPrint
RSS for tagAirPrint allows photo and document printing in your iOS apps and macOS apps without the need to download or install drivers.
Posts under AirPrint tag
15 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Environment
iPad:10th
iOS:18.1
Printer:EPSON PX-S730
Problem
In iOS18.1, When printing with AirPrint, PrintCenter is no longer displayed on AppSwitcher.
In iOS17, PrintCenter was displayed on AppSwitcher.
Question
Is this a specification change?
I would like to know if there is a way to check PrintCenter on AppSwitcher in the same way as iOS17.
Ref
No information after iOS18.1 update.
https://support.apple.com/ja-jp/109349
There is no mention of AirPrint updates in the AppleDeveloper release notes.
https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-18-release-notes
https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-18_1-release-notes
-Environment
iPad:10th、iOS:17.6.1、Printer:EPSON PX-S730
-Question
Is this phenomenon due to iOS specifications?
Restarting the iPad solves the problem, but I don't think it's best practice to restart it every time you reproduce it.
Please let me know if you have a good solution.
-Problem
I am developing a print preview screen using AirPrint's print method.
If you submit a print job using AirPrint on an iPad while the printer is turned off and then cancel it, the print center remains on the app switcher.
After that, when I turned on the printer, I was no longer able to print using AirPrint on my iPad.
When using AirPrint's API "print" and when printing by launching AirPrint from Safari, we have confirmed the same behavior in both cases.
-How to reproduce
Turn off the printer
Print from iPad to printer using AirPrint
Launch the print center from the app switcher, cancel the print job, and set the number of print jobs to 0.
When you start the app switcher, the Print Center app remains.
In step 4, turn on the printer and print from the iPad to the printer using AirPrint.
When you start Print Center from the app switcher, the print job status becomes "Waiting" and the print job is not executed.
-Expected result
When there are no print jobs on the print center, the print center is closed on the app switcher.
You can print from your iPad to the printer using AirPrint, and then print from the printer.
-Actual results
When there are no print jobs on the print center, the print center remains on the app switcher without being closed.
In the above situation, when printing from the iPad to the printer using AirPrint, the printer does not print.
When I start the print center, the print job status is "Waiting" and is queued.
-Code
printInfo.jobName = "Print Job"
printController.printInfo = printInfo
let pdfURL = Bundle.main.url(forResource: "sample", withExtension: "pdf")!
printController.printingItem = pdfURL
let printer = UIPrinter(url: printerUrl)
printController.print(to: printer, completionHandler: { [self] printController, completed, error in
if(error != nil){
print("error").
}else if completed{
print("completed") //this scenario handles completion response
}else{
print("cancel")
}
})
-Link of API used
Apple Developer-AirPrint-print
-Similar inquiries
Apple Developer Forum - Print Center on my iPhone shows a pending document to print and I can't get rid of it
Environment→ ・Device: iPad 9th generation ・OS:**iOS17.5.1 ・Printer model:EPSON PX-S730
Current issues→
01). After canceling a print job in the Print Center, the Print Center screen on the iPad does not close.
02). When the printer is turned on and a new print job is sent, the Print Center shows the ongoing waiting job instead of proceeding with printing.
Problem Description→
The AirPrint feature on an iPad 9th generation running iOS 17.5.1 is being used with an EPSON PX-S730 printer. When sending a print job while the printer is off, the Print Center shows the ongoing printing job. If the print job is canceled in the Print Center, the Print Center screen on the iPad does not close. After turning on the printer and sending the print job again, the Print Center shows the ongoing waiting job.
What I want→
The Print Center screen on the iPad to close automatically after canceling a print job.
Test code:
Note: printController.print response is completed but Print Center status is waiting
let printInfo = UIPrintInfo(dictionary: nil)
printInfo.jobName = "Print Job"
printController.printInfo = printInfo
let pdfURL = Bundle.main.url(forResource: "sample", withExtension: "pdf")!
printController.printingItem = pdfURL
let printer = UIPrinter(url: printerUrl)
printController.print(to: printer, completionHandler: { [self] printController, completed, error in
if(error != nil){
print("error").
}else if completed{
print("completed") //this scenario handles completion response
}else{
print("cancel")
}
})
Environment→ ・Device: iPad 9th generation ・OS:**iOS17.5.1 ・Printer model:EPSON PX-S730
Current issues→
An error message is not returned from the printer if a print job is sent while the printer is off.
Problem Description→
The AirPrint feature on an iPad 9th generation running iOS 17.5.1 is being used with an EPSON PX-S730 printer. When sending a print job while the printer is off, the Print Center shows the ongoing printing job, but the printing cannot be executed because the printer is off.
What I want→
I would like an error to be returned when I submit a printing job while the printer is off.
Test code:
Note: printController.print response is completed but Print Center status is printing
let printInfo = UIPrintInfo(dictionary: nil)
printInfo.jobName = "Print Job"
printController.printInfo = printInfo
let pdfURL = Bundle.main.url(forResource: "sample", withExtension: "pdf")!
printController.printingItem = pdfURL
let printer = UIPrinter(url: printerUrl)
printController.print(to: printer, completionHandler: { [self] printController, completed, error in
if(error != nil){
print("error").
}else if completed{
print("completed"). //this scenario handles completion response
}else{
print("cancel")
}
})
Ever since the advent of Ventura, saved print settings don’t save detailed selections. Even with Sonoma, almost 2 years later, this issue is still a problem! There is a plethora of Apple Support Community topics to that end:
Print settings don't work any more when upgraded to Ventura
Updated to Ventura—printer presets won’t save
Ventura—Custom Printer Settings not being saved
Printer Not working after Ventura 13.0 update
Problem saving print presets in Ventura
Ventura is not saving printing presets (fully)
Printing Problem with Ventura
macOS Ventura (13.1) print settings don’t save—any resolution?
Printer presets don’t save in Ventura
Print settings are a MESS in Ventura
We are hoping to port our app which requires printing to visionOS. Can I check if visionOS supports AirPrint/printing? If anyone has already done it, anything we should watch out for?
Hi,
In Windows and Linux, it's possible to ask a printer to print content programmatically in Black & White. This may be referred to as "Monochrome", "Grayscale", "B&W", depending on the device driver.
For feature parity with other operating systems, I'd like to do the same -- programmatically -- in macOS using Objective-C or Swift. Is this possible? If not, what's the best, formal way to request this useful OS feature to Apple so that it may be added in a future release?
More context about this request:
https://github.com/openjdk/jdk/pull/18195
UIPrintInteractionController crashed when I use it to print a html content.
Fatal Exception: NSInternalInconsistencyException
UITableView dataSource returned a nil cell for row at index path: <NSIndexPath: 0x938e90f84baaa518> {length = 2, path = 1 - 0}. Table view: <UITableView: 0x107991000; frame = (0 0; 375 419); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x2846b0000>; backgroundColor = <UIDynamicSystemColor: 0x281d2e400; name = systemGroupedBackgroundColor>; layer = <CALayer: 0x2848aa480>; contentOffset: {0, -56}; contentSize: {375, 357.0830078125}; adjustedContentInset: {56, 0, 0, 0}; dataSource: <UIPrintOptionsTableViewController: 0x107973800>>, dataSource: <UIPrintOptionsTableViewController: 0x107973800>
here is the code
private let webView = WKWebView()
private let printController = UIPrintInteractionController.shared
func showPrintView(encodedHtml: String) {
printController.delegate = self
let decodedHtmlString = base64Decode(encodedHtml)
webView.loadHTMLString(decodedHtmlString, baseURL: nil)
loadPrint()
}
private func loadPrint() {
let printInfo = UIPrintInfo(dictionary: nil)
printInfo.orientation = .landscape
printController.printInfo = printInfo
printController.printFormatter = webView.viewPrintFormatter()
Timer.scheduledTimer(withTimeInterval: 0.6, repeats: false) { _ in
self.printController.present(animated: true) { _, _, error in
guard let error = error else { return }
self.error = error
}
}
}
private func base64Decode(_ text: String) -> String {
if let restoreData = Data(base64Encoded: text) {
if let restoreString = String(data: restoreData, encoding: .utf8) {
return restoreString
}
}
return ""
}
I'm sure did nothing with UIPrintOptionsTableViewController so I have no idea how did this crash happened and how to fix it. Can someone help me?
After updating to the lates OS many of the standard page sizes have disappeared from the HP Officejet Pro 7740 setting such as the full bleed 8.5 x 11 and full bleed 11 x 17... is this up to to correct or HP?
For printing from worker thread to a UIPrinter(whose url i have saved ) i am doing this and able to print :
func PrintPdfDocument (pDocument:Data)
{
// Create a print interaction controller
let printController = UIPrintInteractionController.shared
// Set the printing options
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.jobName = "Print Job "
printController.printInfo = printInfo
printController.showsPageRange = true
// Set the PDF document to be printed
printController.printingItems = pDocument
printController.print(to: defaulttprinter, completionHandler: { (controller, completed, error) in
if completed {
print("Printing successful!")
} else {
if let error = error {
print("Printing failed with error: \(error.localizedDescription)")
} else {
print("Printing was canceled.")
}
}
})
}
When i call PrintPdfDocument (pDocument:Data) function , more than once with diffrent data shown below :
DispatchQueue.global().async {
PrintPdfDocument (pDocument:data1)
}
DispatchQueue.global().async {
PrintPdfDocument (pDocument:data2)
}
DispatchQueue.global().async {
PrintPdfDocument (pDocument:data3)
}
Printer is printing only one document(data1) .
For other call is not executing printController.print (to....) function inside PrintPdfDocument.
I'm working with cupsfilter command to convert files from PDF to PS.
We had been previously working with cupsfilter on Linux, but we had to migrate to macOS and some of the command line arguments are not compatible.
In particular, we can't control autorotation and scaling on macOS. They seem to be "on" by default, but there are some cases where we need to turn them "off" so page doesn't rotate or scale to fit automatically.
On Linux, those options are controlled with -o nopdfAutorotate and -o nofit-to-page.
Any ideas how to control rotation and scaling on macOS?
Thank you very much in advance.
I want to use CUPS in iOS for printing and it is mentioned at many places that we can use cups for printing in ios .But when i import library cups/cups.h ,xcode is giving error "cups/cups.h not found".
code i am using in a objective c file :
import &lt;cups/cups.h&gt;
cups_dest_t *dest;
int num_options;
cups_option_t *options;
int job_id;
/* Print a single file */
job_id = cupsPrintFile(dest-&gt;name, "/usr/share/cups/data/testprint.ps",
"Test Print", num_options, options);
Do i need to intall some driver or any library to make it work ? or is it the case that CUPS is not available for iOS?
After updating to Mac OS Sonoma, we have encountered compatibility issues with our iPad-designed application, specifically with the AirPrint functionality, when it is run on MacOS. The AirPrint feature stopped working properly through UIPrintInteractionController.shared.
We have noticed that when we compile the application using Catalyst, the AirPrint functionality is restored and works as expected. However, this solution is not viable for us due to the restrictions associated with the frameworks we are utilizing.
We are seeking alternative solutions, and any help or guidance would be highly appreciated to resolve this issue and ensure a seamless and uninterrupted user experience in our application.
STEPS TO REPRODUCE
Create an app for ipad with just a button and this code
var str = "TEST"
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.outputType = .general
printInfo.jobName = "Report"
printInfo.orientation = .portrait
let printController = UIPrintInteractionController.shared
printController.printInfo = printInfo
printController.showsNumberOfCopies = false
printController.showsPageRange = false
printController.showsNumberOfCopies = false
let formatter = UIMarkupTextPrintFormatter(markupText: str)
formatter.contentInsets = UIEdgeInsets(top: 72, left: 72, bottom: 72, right: 72)
printController.printFormatter = formatter
printController.present(animated: true, completionHandler: nil)
2.Run it on a MacOS with Sonoma, there is no error on console or anything but it don't work.
-If you run it with Catalyst it just works when adding the Printing permission of App Sandbox in Signing & Capabilities.
Starting iOS 16 seeing some crashes related to pdf printing in the crash reporter. It looks like the issue is not so frequent. Also, I'm unable to reproduce the crash. Looks like the app crashes when the print preview dialog is opening. According to crash reports, there are some crashes on different iOS 16 versions: 16.0.0, 16.0.2, and 16.0.3.
Printing code:
let printInfo = UIPrintInfo.printInfo()
printInfo.jobName = "Printing Job Name"
self.printViewController = UIPrintInteractionController.shared
self.printViewController?.printInfo = printInfo
self.printViewController?.printingItem = pdfURL
self.printViewController?.present(from: barButtonItem, animated: true) { (controller, completed, error) in
self.printViewController = nil
}
Stack trace:
compare_key + 4 (CGPDFObject.c:134)
bsearch + 68 (bsearch.c:70)
CGPDFDictionaryGetUnresolvedObject + 68 (CGPDFDictionary.c:153)
CGPDFDictionaryGetObject + 44 (CGPDFDictionary.c:172)
CGPDFDictionaryGetDictionary + 44 (CGPDFDictionary.c:284)
get_pages_dictionary + 68 (pdf-reader.c:410)
pdf_reader_get_number_of_pages + 76 (pdf-reader.c:557)
-[UIPrintPreviewPageFetcher fetchNumberOfItems] + 76 (UIPrintPreviewPageFetcher.m:115)
-[UIPrintPreviewViewController collectionView:numberOfItemsInSection:] + 32 (UIPrintPreviewViewController.m:482)
-[UICollectionViewData _updateItemCounts] + 220 (UICollectionViewData.mm:335)
-[UICollectionViewData isIndexPathValid:validateItemCounts:] + 52 (UICollectionViewData.mm:348)
-[UICollectionViewData validatedGlobalIndexForItemAtIndexPath:] + 36 (UICollectionViewData.mm:778)
-[UICollectionView _cellForItemAtIndexPath:] + 108 (UICollectionView.m:7112)
-[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:] + 1384 (UICollectionView.m:9357)
-[UICollectionView _updateRowsAtIndexPaths:updateAction:updates:] + 396 (UICollectionView.m:9104)
-[UICollectionView reloadItemsAtIndexPaths:] + 52 (UICollectionView.m:9124)
-[UIPrintPreviewViewController reloadVisibleItems:] + 256 (UIPrintPreviewViewController.m:568)
__63-[UIPrintPreviewViewController updatePdfURL:options:completed:]_block_invoke_2 + 44 (UIPrintPreviewViewController.m:305)
__NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 24 (NSOperation.m:1545)
-[NSBlockOperation main] + 104 (NSOperation.m:1564)
__NSOPERATION_IS_INVOKING_MAIN__ + 16 (NSOperation.m:2189)
-[NSOperation start] + 708 (NSOperation.m:2206)
There is full stack trace I got from the Organizer
Thanks!