UIPrintInteractionController set minimum number of copies

559 Views Asked by At

I'd like to know if there's a way to set a minimum number of copies to be printed via code, because I need a document to be printed by duplicate.

I read the documentation on Apple developers page but I couldn't find anything.

I know you can set the number of copies from the printer dialog, but I need the minimum to be 2 by default.

Thanks in advance!

EDIT:

I tried this and it didn't work for me, at least in Xamarin.

1

There are 1 best solutions below

1
On

There is nothing exposed via UIPrintInteractionController or its delegates that allows you to change/override the number of copies.

The way I approach this is to write my own UIController that defines the properties that the user is allowed to change and then use UIPrintInteractionController.PrintToPrinter to directly print the content.

Another approach is to disable the number of copies display:

UIPrintInteractionController.ShowsNumberOfCopies = false;

And then provide a two element array to PrintingItems vs. PrintingItem that just contains two copies of your print object.

Another approach just allow the user to select the printer via UIPrinterPickerController, save the UIPrinter to skip it in the future and then call PrintToPrinter twice.