Lofens
Lofens

Reputation: 161

iOS: print with printerID without selecting printer

I am able to print through my app by selecting a printer / amount of pages and press print afterwards, all by using the UIPrintInteractionController and UIPrintInfo.

Now have I set the printerID to the simulator or our own printer, but it still gives me the same view as before, no printer selected.

I've read about setting the default printer by setting printerID, all I notice however is a longer load time, same view, no printer selected automatically.

What I would like to do is simply print the tekst I want to print without selecting a printer everytime.. so setting a printerID in my code (editable in app options) and than simply print to that printer with 1 click. Is this possible?

Thanks in advance

Upvotes: 2

Views: 884

Answers (1)

karmington
karmington

Reputation: 204

I did it like this: ( pic is the PrinterInteractionController )

printInfo.printerID = @"Brother QL-710W._ipp._tcp.local";
pic.printInfo = printInfo;
pic.showsNumberOfCopies = NO;
pic.showsPageRange = NO;

You still get the dialog, but user just has to press 'Print'.

However, it broke when the printer got changed, am just now working on it so it is a sub-optimal solution in the long run. There does not seem to be any way to skip the dialog completely.

Upvotes: 1

Related Questions