I'm using UIPrintInteractionController
presenting it from rect.
UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController];
// than set printing settings
...
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
[controller presentFromRect:rect inView:view animated:YES completionHandler:completionHandler];
Than I set number of pages (>1) and select a printer. Before devices rotation I call
[controller dismissAnimated:animated];
according to Xcode documentation: You should dismiss the printing options when they are presented in a sheet or animated from a rectangle and the user changes the orientation of the device.
When I present UIPrintInteractionController
after rotation, the number of printing copies is set back to 1 (as in initial view), whereas printer remains selected.
Ivar _copies of UIPrintInfo is private, so I can't get it and store during rotation.
How can I restore the number of printing pages after rotation?
Sorry this may seem a bit of an obvious question but have you called it as a delegate?
UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController];
controller.delegate = self;
[printInfo setValue:[NSNumber numberWithInteger:numberFile] forKey:@"copies"]
You can set and set @"copies"
of UIPrintInfo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With