Trying to configure IOS UIPrint print settings

I am trying to change the print options that appear when using UIPrint.

UIPrintInteractionController *pic; void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) { if (!completed && error) { NSLog(@"Printing could not complete because of error: %@", error); } }; [pic presentAnimated:YES completionHandler:completionHandler]; 

There is a delegate to which you can answer:

 - (UIViewController *)printInteractionControllerParentViewController:(UIPrintInteractionController *)printInteractionController 

If I return from it, a dialog box will appear. If I return the navigation manager view manager, then the print options will not appear. I have no idea why.

On the corresponding issue, you can get a list of printers without using print options at all, and then print on a specific printer (thereby losing the need to display a representation of the printer settings).

+4
source share
1 answer

As for changing the parameters displayed in the dialog box, you can look at the [UIPrintInfo] object . You basically tweak this object and then apply it to the UIPrintInteractionController using the printInfo property.

I don't have much advice on using a navigation controller as a parent. Ive done this in the past with no problems. When you set the parent to nil, it shows the system dialog as modal. When configured for a navigation controller, it slides from the side, like a normal view. I have no understanding why it does not work for you. Sorry!

As for printing without dialogue, I just answered the same basic question:

IOS Printing Without UIPrintInteractionController Permission

+2
source

Source: https://habr.com/ru/post/1416466/


All Articles