简体   繁体   中英

UIPrintInteractionController - Limit print copies / Get number of printed copies

I'm developing an iPad app that includes the ability to print a document. Some documents require rights management wherein a limited number of copies may be printed and the number of copies printed must be recorded.

I've scoured the UIPrintInteractionController documentation and have found no such capabilities. This question was asked here over a year ago: iOS Printing UI - limit number of copies and at the time this feature was not available - here's hoping it has since changed.

My questions are:

  1. A year later, does cocoa touch still not have the ability to limit number of copies that can be printed?
  2. Is there any way to GET the number of copies printed?
  3. Is one forced to use the UIPrintInteractionController? If I'm unable to set or get copies, then I may be forced to write my own (if at all possible).

Trying to control the number of copies a user can print using UIPrintInteractionController. I have the same problem and I was walking home and it hit me. Why dont I just create a category for the UIStepper and override its behavior.

I dont use the UIStepper in my app so this wont effect my app, but if you do theres probably a way you can selectively apply this code.

Anyway, you want something like this:

@implementation UIStepper (MJStepper)

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        self.minimumValue = 1;
        self.maximumValue = 1;
    }
    return self;
}

@end

So create a category and include it in the same view which uses the UIPrintInteractionController

Then set the min and max values on init, and BAM. The print modal says 1 copy and has no uistepper. :)

You could set this to any number programmatically or even give the user a fixed range.

I really wish Apple had a full programmatic API for printing. I am building a Kiosk app and the last thing I want is for the user to be able to print 100 copies of something.

I think the paper type and printer selection is still annoying but I can probably live with that.

Does anyone know if theres a way to control what Paper types your printer supports? I know theres a delegate callback which I might be able to use to force a specific type of paper so I might try that.

Anyway, hope this helps! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM