Latest 0.2.1
Homepage https://github.com/eahrold/Objective-CUPS
License MIT
Platforms osx 10.8, requires ARC

Objective-C framework for interacting with CUPS.

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
OCPrinter *printer = [OCPrinter new];
printer.name = @"laserjet";
printer.host  = @"mycups.server.com";
printer.protocol = @"ipp";
printer.description = @"LaserJet";
printer.model = @"HP LaserJet 4250";

// add it
OCManager *manager = [OCManager alloc] init];
[manager addPrinter:printer error:&error];

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

// and many more...

Print file

Print file and monitor via Block…

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

see OCManager.h for more info

Latest podspec

{
    "name": "Objective-CUPS",
    "version": "0.2.1",
    "summary": "Objective-C framework for interacting with the CUPS system.",
    "description": "                    Objective-C framework for interacting with the CUPS system. The Printer object conforms ton                    NSSecureCoding to be used with a NSXPC Service and priviledged helper tool so non-adminn                    users can manage printers themselves.n",
    "homepage": "https://github.com/eahrold/Objective-CUPS",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "Eldon Ahrold",
    "source": {
        "git": "https://github.com/eahrold/Objective-CUPS.git",
        "tag": "0.2.1"
    },
    "source_files": [
        "Objective-CUPS",
        "Objective-CUPS/**/*.{h,m}"
    ],
    "libraries": [
        "cups",
        "z"
    ],
    "platforms": {
        "osx": "10.8"
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This