CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

Objective-CUPS 0.2.1

Objective-CUPS 0.2.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Eldon Ahrold.



  • By
  • Eldon Ahrold

Objective-C framework for interacting with the CUPS system. The OCPrinter object conforms to NSSecureCoding to be used with a NSXPC Service and priviledged helper tool so non-admin users can manage printers themselves.

Add / Remove OCPrinter

NSError *error;

// set up a printer
OCOCPrinter *printer = [OCPrinter new];
printer.name = @"laserjet";
printer.host  = @"mycups.server.com";
printer.protocol = @"ipp";
printer.description = @"LaserJet";
printer.model = @"HP LaserJet 4250";

// add it
CUPSManager *manager = [CUPSManager new]
[manager addOCPrinter:printer error:&error]

// remove it
[manager removeOCPrinter:printer.name error:&error];

// and many more...

Print file

Print file and monitor via Block...

[_manager sendFile:@"/tmp/test.txt" toOCPrinter:_printer.name failure:^(NSError *error) {
    NSLog(@"%@",error.localizedDescription);
} watch:^(NSString *status, NSInteger jobID) {
    NSLog(@"%@",status);
}];

see OCManager.h for more info