Cups 0.0.6 Released

Just to let everybody know that I bumped the cups version number to 0.0.6 the other day. The new version of the gem is on gemcutter so you can grab the upgrade next time you update.

Comments (7)

Mar 28, 2010
blkperlarticfox said...
I love this gem. Is there a way to tell the printer to do duplexing with it?
Mar 28, 2010
Chris Mowforth said...
I'd need to implement the api functions for setting printer options, which I may try & do soon (or if you or anybody else has a patch...). Do you know which cups printer options enable duplex printing when you're using lpr?

Thanks,

Chris
Mar 28, 2010
blkperlarticfox said...
I believe it is lpr -o Duplex=DuplexNoTumble

Thanks blkperl

May 27, 2010
Randy said...
Does your reply "I'd need to implement the api functions for setting printer options" mean that there is no way to control whether the page prints as portrait or landscape (lpr -o landscape...)?

I have a PDF file containing only the words "should be portrait" that prints as a portrait page from PDF viewers like osx Preview, but as landscape when I submit it via a ruby script using the cups gem.

Is there a way to specify portrait from the ruby api?

May 27, 2010
Chris Mowforth said...
Not at the moment. I've pushed an 'options' branch to github which I'm working on but it's at the bottom of my todo list right now. May have some time to look at it this weekend.
May 27, 2010
Randy said...
When I print file "x.pdf" using cups from the osx command line, like "lpr x.pdf", the page is printed in portrait layout. But via ruby using the gem, it is landscape. I don't know where the difference is - both lpr and the ruby gem are using cups, and the file is identical. The file was created in Prawn using the :page_layout => :portrait option, but that specification is being overridden somewhere.
May 27, 2010
Randy said...
A workaround is to create a "lp printer instance" using the command line program 'lpoptions' that contains the "-o portrait" specification. But when I call Cups::PrintJob.new(x.pdf, 'printer_xyz/instance_name_a') I always get "The printer or destination does not exist". And Cups.show_destinations() shows only the 'printer_xyz' bit, not the "slash instance_nam_a" part. The ruby code does not like the embedded slash!

Back on the command line, "lpstat -a" shows that the printer instance really does exist, with the expected syntax.

So for now, I just fork & exec the entire ruby interpretor with 'system("lpr -o portrait -P printer_xyz x.pdf")' for each file (or set of files) that I have to print. I have thousands of files, and the overhead of fork & exec must be a thousand times greater than CUPS, but it works for now.

Leave a comment...