Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Duplex option not available #19

Closed
brunnels opened this Issue · 8 comments

3 participants

Benjamin Runnels Simon Cadman Jacob Floyd
Benjamin Runnels

I have a brother hl-2270dw printer connected through cloud print. It supports duplex printing. When I go to the google cloud print "try it now" the duplex option is available for my printer with "off", "long edge", and "short edge" selections. By selecting one of the options and printing multiple pages the printer does print on both sides of the page as expected.

There is no duplex option available for the printer when installed via the cups cloud print driver in ubuntu 12.10 x64.

Can you please add support for duplex printing to the cups cloud print driver?

Simon Cadman
Owner

Ok thanks for reporting, I will take a look

Jacob Floyd

Same with my KODAK All-in-one Hero 6.1 printer. I can do duplex printing from my chromebook with the google's print dialog, but I can't select duplex from my linux box using CUPS-Cloud-Print on gentoo linux.

Jacob Floyd

After some investigation, it looks like Google is not sending a capabilities section for my printer. CUPS-Cloud-Print on my box gets the capabilities section for the "Save to Google Drive" and "Print to FedEx Office" printers. the other 8 printers don't get it.

To test that, I added print(printers) to line 56 of setupcloudprint.py

Jacob Floyd

OK, Continuing my test, google reports the printer capabilities if you query /printer instead of /search

Essentially, I'm hijacking setupcloudprint.py to test different queries. I changed the following at about line 45

for requestor in requestors:
  #responseobj = json.dump(requestor.doRequest('search?connection_status=ALL&client=webui'))
  responseobj = json.dump(requestor.doRequest('printer?printerid=[printerid]'))
  print(responseobj)
  continue

When I use /search (like in printer.getPrinters), then only the Drive and Fedex printers return a capabilities section. If I query /printer (using an id returned in a /search request), then it returns all of the printer's capabilities including the section:

{"type": "Feature", "psk:DisplayName": "Two-sided Printing", "name": "psk:JobDuplexAllDocumentsContiguously", "psf:SelectionType": "psk:PickOne", "options": [{"default": True, "psk:DisplayName": "None", "name": "psk:OneSided"}, {"psk:DisplayName": "Flip on long edge", "name": "psk:TwoSidedLongEdge"}, {"psk:DisplayName": "Flip on short edge", "name": "psk:TwoSidedShortEdge"}]}
Jacob Floyd

In case you couldn't tell, this is my first time playing with the gcp api. So, it's documented that /search doesn't return the capabilities part. It also appears that you already have printer.getCapabilities which uses printer.getPrinterDetails which in turn uses /printer to request the details. The only time that printer.getCapabilities is invoked, however, is when it does a /submit to print something.

In order to use duplex printing, CUPS needs to know whether or not the printer has that capability (by default, the option to use duplex printing is disabled and can't be selected in the dialogs). I don't know how to tell CUPS about that, yet. But, for CUPS to know, CCP needs to know first. So, setup would need to check and see if the printer can do duplex and then tell CUPS. Besides that, how would CCP /submit a duplexed printjob to GCP if all it does is copy the capabilities that GCP provides?

But, on further investigation, all of the physical printers (not fedex, drive, or android) return the Two-sided Printing option, even if the printer doesn't do two sided printing. One of the printers had a bunch of namespaced HP specific duplex options in addition to the standard one. My Kodak printer, however, only has the default Two-sided Printing option, and it is able to print on both sides.

Jacob Floyd

So, it looks like CCP needs to somehow manipulate the capabilities it sends in /submit in order to do things like duplex printing or changing the orientation (another issue). It looks like copying capabilities makes it so that CCP can just use the defaults. How can CCP send something other than the defaults? I couldn't find an example, and I've run out of time to play with this for today.

@simoncadman, I hope my testing helps, even though I suspect you already knew everything I just learned.

Simon Cadman
Owner

Wow, thanks for the investigation and testing work @cognifloyd , this has helped confirm what I was thinking - CUPS pulls the printer details from the PPD file attached to the printer, so basically CCP needs to dynamically generate the PPD file when adding the printer, as you suggested.

Thanks

Simon

Simon Cadman
Owner

I've now completely reworked the way capabilities are exposed to CUPS, so they mirror exactly what Google is reporting as capabilities for a printer, this should fix all issues where options for printers were not selectable previously.

Release 20130504 ( rolling out currently ) onwards have this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.