My printers don't support automatic duplex printing. I'm looking for a solution for my Mac and Linux computers that I've seen with most Windows printer drivers:

Check "Manual duplex" in the printer screen

Printer starts printing one side

A dialog appears, asking me to flip the pages

Printer prints the other side.

One thing I can do, is print odd pages, then reopen the dialog and print even pages, but this is very inconvenient, especially when I only want to print a certain page range of the document as the Mac dialog forgets my previous page range every time. It gets even more inconvenient, when printing 2-up double sided, or when changing additional settings for this one printout.

Is there maybe some tool, that can do this? Or maybe a "virtual printer driver" that can sit somewhere between the dialog and the actual printer driver, which manages these steps? (The Windows tool http://en.wikipedia.org/wiki/FinePrint can do something like that, but I don't need all of its features, and I need it on Mac/Linux.)

Or does somebody maybe know a trick, how to make the print dialog stay open, i.e. "Print, but don't close"?

Update

It doesn't seem, as if a tool like that exists yet. How hard would it be to implement something like that? Where would it need to be integrated - as a CUPS printer driver, or as a hook for the print action of the dialog? Could it work cross-platform, or would it have to be Mac/Linux-specific?

Can somebody with experience in Mac/Linux/driver programming shed a light on this?

Solution

The current solution:

Create an Apple Automator script:

Action: Extract Odd & Even Pages [All pages in separate files]

Action: Run Shell Script [Pass input as arguments]

mv "$1" /tmp/odd.pdf
mv "$2" /tmp/even.pdf
lpr /tmp/odd.pdf

Action: Ask for Confirmation ["Please flip the pages"]

Action: Run Shell Script [Pass input as arguments]

lpr /tmp/even.pdf

It's not perfect yet. Suggestions for improvements and alternatives are very welcome!

Retagged to reference CUPS, which is what OS X and Linux distributions use.
–
BroamMar 23 '10 at 18:43

@Broam: Thanks, the cups tag is a very good idea.
–
Chris LercherMar 23 '10 at 22:47

As an aside: some printers might also need the odd pages to be printed in reverse order...? (For otherwise one needs to rearrange the pages in between the two print jobs.) Hmmm.
–
ArjanApr 1 '10 at 18:20

6 Answers
6

ALMOST, but no cigar yet: the 4th step only gets the odd pages from the 1st step, and then takes the even pages from that set... That's no good. I will delete this some time later, unless I think of something smart. (The 1st step can also be made to create two files right away, but you need the confirmation dialog. Maybe there's some "restart" or parallel processing in Automator.

For a Mac, Automator is your friend:

Open Automator

Select "Print Plugin" (Print plugins are workflows that are available in the print dialog. They accept PDF versions of the document being printed. Prior to 10.6 Snow Leopard, you might not get this choice until you're about to save your workflow, rather than when creating an empty workflow. Should work the same.)

Drag the following items into the workflow to the right:

"Extract Odd & Even Pages", and select "Odd"

"Print Finder Items"

"Ask for confirmation", write some instructions

"Extract Odd & Even Pages", and select "Even"

"Print Finder Items"

Save it. It will end up in ~/Library/PDF Services/ and hence be part of the PDF menu in the Print dialog.

When the total of pages is odd, you'll have to fiddle a bit with the first or last page of the first run. (If you'd put the whole stack back into the printer, then the last page might be left in the paper tray when you're done. Just try and adjust the instructions in step 3.)

@Arjan: Good idea! I don't have much experience with Automator - I hope there's a way to access both PDF files that are created by "Extract Odd & Even Pages". I haven't found it yet, either.
–
Chris LercherApr 1 '10 at 18:36

1

@chris, I guess we'll need some command line thing to get it done. Still, Automator could be used to execute any command, and the integration with the Print dialog is nice. Also, Automator plugins to print a booklet exist, so maybe there's some plugin for duplex too...
–
ArjanApr 1 '10 at 18:57

@Arjan: Again a very good idea: Automator combined with a bash script. I think, we're getting closer! How do I pass the output (PDF) to the script? I need it either as a file (or two files), or from stdin.
–
Chris LercherApr 1 '10 at 19:17

@chris, the first steps are no problem, see dltj.org/article/pocketmodmac However, the Bash script must also invoke the actual printing, and show the dialog in-between the two jobs. (I have not found a way to pass the resulting file names back to Automator, but it might be doable.)
–
ArjanApr 1 '10 at 19:23

I wrote it a long time ago and couldn't generate any interest in it so I have not updated it. If I can get an active user base of > 0, or someone interested in helping to develop or test it, I'll work on it again. I even have newer development code that has a few additional features. I'm also playing around with making it gui-enabled so it can be used from the desktop without going to the command line.

It's a set of bash scripts that emulate duplex printing for non-duplex printers. I've used it every day - for many years now.

One unique feature is that it allows batch two-sided printing so you can print several jobs at once and you only have to flip and reinsert the whole stack of paper once instead of once for each job.

The current version (on sourceforge) has a few problems. The first is that they changed bash. To get the current scripts to work (after you download them), the first line of each script has to be changed from #!/bin/sh to #!/bin/bash

The other problem is a design issue. Printers vary in how they handle paper. Some put out pages with the printed side face-up and some with the printed side face-down, etc. This means that there has to be more than one duplex printing algorithm. duplexpr currently supports only one algorithm. It works perfectly on printers like the HP Deskjet 720 and 895 (old) and the HP C4480 (newer). It almost works on my HP Laserjets (1006 and 1020). On these, all the pages it prints are correct and in the correct order, but each page needs to be flipped over manually after the job has finished printing (they come out 2/1, 4/3 ... instead of 1/2, 3/4).

Check it out and get back to me if you are interested in using it. You can send me email via the sourceforge project page (url above).

A few more thoughts:

duplexpr doesn't really address printing ranges of pages. You can do that by using the "print to file" and "page range" options available in most application print dialogs.

Once you have the output in a file (in the default (at least for Linux) postscript format), you have a number of options. You can then run it through duplexpr (which, by the way, handles the odd number of pages problem mentioned by other posters).

If you can handle using the command line interface (cli), then the lp command - or lpr, whichever you have installed, has options you can specify for odd pages only, even pages only and you can even give it page ranges if necessary. If that's not to your liking, there's an amazing little gui utility called xpp that will do all that and more. It will even let you create an alias for one of your existing printers that will print only even or odd pages. I use it all the time to recover from paper jams and multiple page feeds during the second pass of duplex printing (the second sides) so I can finish printing any one-sided pages didn't get trashed without starting from scratch.

With any of these manual methods, if you have an odd number of pages, you can just send a formfeed to the printer to eject the last page:

echo -n $'\f' | lp

will do it or you can create a file with just a formfeed in it and send it to lp. This works on every printer I have tried so far.

Either way, it's a lot easier than remembering not to reinsert the last page, etc.

I've seen old booklet-printing software that had a nice trick to determine how a printer handles the pages. It printed some circles and numbers on two pages, then makes you put the pages back into the paper tray exactly like you've taken them from the output (no turning, no flipping), and then prints some squares on the same two pages. The combined result one sees on the top page then tells the software how the paper was handled. Hence, if you ever continue this project, then coming up with something like that might help finding the correct configuration. :-)
–
ArjanMay 12 '10 at 22:21

This sounds phantastic - I will check it out next week. If you continue the project (please!), I'd be glad to do some testing with my printers, as long as you can give me instructions how to do it (I have a Kyocera Mita laser + a Canon inkjet. They handle the paper differently.) In the past, I had always used tools like TurboPrint Professional (on the Amiga!) or FinePrint Professional, or the Windows printer drivers - where most actually have this advantage over Mac/Linux :-( Our OS need such a tool - GUI integration would be great, but let's start with the basic functionality!
–
Chris LercherMay 14 '10 at 18:47

@ Arjan - I added a file a bit like that to the package when I last updated it. I still don't have any options to compensate for printers that do it differently.
–
JoeOct 4 '11 at 6:14

@Chris: Sorry for the extremely late reply. Didn't get any notification that there were replies to my post. If you're still out there, send me an email through my duplexpr site. I did update the project 10/29/2010. It has a few less bugs and a few more features. It would be great to see how it works with your printers.
–
JoeOct 4 '11 at 6:23

Can you explain what it does and how it works?
–
slhck♦Nov 10 '11 at 21:22

Brilliant! The software adds a printer pane which guides you through the process of flipping/turning the printed pages and reinserting them into your printer. I just used this on MacOS X 10.7.5 with an old LaserJet 4M Plus and it worked great.
–
Dan BarowyFeb 25 '13 at 2:11

In the "virtual printer driver" vein, you might try printing to Postscript or PDF from your application. This would especially help when printing a certain range or a complicated 2-up pagination.

The general idea is, "print" from the application with the settings you want (page ranges, pages-per-sheet, etc), but send the output to PS/PDF. Then use your OS's standard PS/PDF printing facility to handle the actual duplexing.

Alternately, run two print jobs from the application. Set the first to generate a PS/PDF of your up-facing pages, and the second to generate a second PS/PDF of your down-facing pages. Then the duplexing is already done, and all you need to do is print the first file, flip the pages and put them back in the printer tray, then print the second file.

It's certainly not the prettiest or most convenient method, but it should be doable by tweaking your workflow -- no additional software required. (I believe on OSX the print-to-PDF capability is built-in; it's fairly simple to configure on Linux if it isn't available out-of-the-box on your distribution.)

Okay, what's the OS's standard printing facility to handle the actual duplexing? AFAIK, the printing dialog is always the same (or isn't it? It seems, that it never has a manual duplex option?)
–
Chris LercherMar 25 '10 at 20:25

When using two print jobs to print to separate PDFs I still have to go through the dialog twice (re-applying all my settings manually.)
–
Chris LercherMar 25 '10 at 20:25

@chris: by "OS standard facility" i'm referring to whatever app allows you to print PS/PDF files; by "handle the actual duplexing" i mean "print-odd-pages first, then-print-even-pages" or something similar. what i'm suggesting kind of fakes software duplexing -- think of it as a workflow to get it done manually. it's not an actual "manual duplex" setting anywhere. unfortunately i don't have a mac so i can't provide any exact tips on OSX print dialogs.
–
quack quixoteMar 25 '10 at 21:18

The situation is this: I can do "print odd pages", then "print even pages" directly from any application. But I have to close the dialog in-between, then re-open it, re-enter the page range manually, etc. Okay, the page range problem would be mitigated, if I first printed it to PDF. BTW, my problem would already be pretty much solved, if the dialog stayed open :-)
–
Chris LercherMar 25 '10 at 21:51

@chris: yeah, but it's not going to. :) that mitigating the page-range issue, that's what i'm saying. if you want to print, say, pages 3-50 of 400 of some document, if you first print that range to PDF, then print the PDF's odd pages, then print the PDF's even, ... yeah, it's not saving lots of time & effort, but at least you don't have to input the range multiple times. fwiw, i'm still hoping to see someone else post a handy software tool that'll make this simpler. :)
–
quack quixoteMar 25 '10 at 22:08

Thanks - however, I just tried it, and it didn't work: It printed all my pages, then showed the dialog to turn over the paper nicely, and then it printed all the pages once again... the project is still in an early stage, and I assume, this problem will be resolved. Thanks for the link! (+1)
–
Chris LercherMay 31 '10 at 18:36