Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having a problem printing a photo via commandline, using CUPS. Im using Mac(tried on Mountain Lion and Mavericks) and Canon Selphy CP900 photo printer. I have the correct drivers.

From the command line, here is my printer info:

$ lpstat -d

system default destination: Canon_CP900

$ lpoptions

copies=1 device-uri=usb://Canon/CP900?serial=C412070200000609 finishings=3 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=0 number-up=1 printer-commands=none printer-info='Canon CP900' printer-is-accepting-jobs=true printer-is-shared=false printer-location=ibomac printer-make-and-model='Canon CP900' printer-state=3 printer-state-change-time=1385005687 printer-state-reasons=none printer-type=2134028 printer-uri-supported=ipp://localhost:631/printers/Canon_CP900

$ lpoptions -l

PageSize/Page Size: *Postcard(4x6in) CP_L_size CP_C_size Custom.WIDTHxHEIGHT

If I view the photo.jpg via Preview app, it lets me print it without problem. here is the screenshot.

Preview Print Settings

Now if try it via commandline like this:

$ lp -o landscape -o fit-to-page -o media=Custom.4x6in photo.jpg

request id is Canon_CP900-18 (1 file(s))

It gets accepted and queued but I get the error:

enter image description here

My suspicion is because in the System Preferences | Printers Scanners, the settings doesnt have the 4x6 size in the list :

enter image description here

So what I did was, I opened Firefox browser, went to page setup, and added a custom size paper thru this dialog box:

enter image description here

I named it "Postcard".

So once I have that addition, going back to Printer Scanners settings, it now lists "Postcard" as one of the custom sizes.

I've tried the commandline print command again but I got the same error. I wasnt expecting Mac to be this hard when it comes to printing (or is it my sucky printer driver?). Pls help.

I want this commanline to work because I want to automate it with my custom program. I use this CUPS documentation as reference.

Somebody help pls? :)

share|improve this question
up vote 0 down vote accepted

I also faced the same issue. Following your steps I manage to print with this command

lp -o media="Postcard(4x6in)" image.png

the media size is one of the listed size in the command

 lpoptions -l

PageSize/Page Size: *Postcard(4x6in) CP_L_size CP_C_size Custom.WIDTHxHEIGHT

note : you have to drop the ''

share|improve this answer
    
thanks for the tip! will try it. i never got it working. didnt realize it was that simple <- not a mac guy ;). – StephenNYC May 3 '14 at 2:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .