[SOLVED] Printer won't print pages in reverse order (Last page to first page).
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Printer won't print pages in reverse order (Last page to first page).
My printer is a HP 1512 Deskjet all-in-one printer/scanner. My operating system is Slackware 14.2 64-bit (updated). The problem is that I have the printout option for it set to "Reverse order" (last-to-first), but the actual printout is always first-to-last no matter what. How to I correct that situation?
1. What version of Slackware are you running? 14.2, -current, something else?
2. What printer system are you using? CUPS, lpr, something else?
3. Is your printer local or remote? If remote, what is your queue management setup? Also, if remote, is the server running on Slackware or something else?
1. What version of Slackware are you running? 14.2, -current, something else?
2. What printer system are you using? CUPS, lpr, something else?
3. Is your printer local or remote? If remote, what is your queue management setup? Also, if remote, is the server running on Slackware or something else?
As I mentioned when I first asked for assistance, my operating system is 14.2 (64-bit, updated). My printer system is CUPS, and my printer is attached directly to my computer (via USB connection).
Okay, sorry about asking you to repeat what you'd already typed. You have a local printer, and it's always printing in-order, not reversed.
I assume you have root access to the machine, so here's an idea.
1. Turn off the printer.
2. Print a multi-page document, in reverse order. This should create a temporary file /var/spool/cups/d* and the final digits will match the last c* file in the same directory. That is to say, if you see /var/spool/cups/d00370-001, there's a /var/spool/cups/c00370 file with job control information. The "d00370-001" file is a PDF.
3. Take a look at that file, using "xpdf". Are the pages in reverse order?
After that:
4. "lprm [job number]" as appropriate, so you don't waste paper or ink. The example files above have job number 370.
I'm wondering what the generated output is inside your CUPS queue. This gives us an idea where the problem might be. If the pages are in reverse order, they're being flipped back around by either CUPS or HPLIP.
Also, are you consistently using the same program to print from? That is to say, Firefox, or LibreOffice? Well, if one of those isn't giving you what you expect, does the other one exhibit the same behavior? That would tell us if it's a driver vs. application issue.
If it looks like I'm spit-balling here... yeah, I am. Sometimes, that's how tech support works. I kind of miss those days, but I'll never again do it for money.
Sometimes I print from Okular, other times I print from LibreOffice, but the output is the same in either case, although I confess that I haven't tried printing from Firefox (primarily due to the fact that Firefox tends to omit at least half of the document or more in the printout).
Okay, sorry about asking you to repeat what you'd already typed. You have a local printer, and it's always printing in-order, not reversed.
I assume you have root access to the machine, so here's an idea.
1. Turn off the printer.
2. Print a multi-page document, in reverse order. This should create a temporary file /var/spool/cups/d* and the final digits will match the last c* file in the same directory. That is to say, if you see /var/spool/cups/d00370-001, there's a /var/spool/cups/c00370 file with job control information. The "d00370-001" file is a PDF.
3. Take a look at that file, using "xpdf". Are the pages in reverse order?
After that:
4. "lprm [job number]" as appropriate, so you don't waste paper or ink. The example files above have job number 370.
I'm wondering what the generated output is inside your CUPS queue. This gives us an idea where the problem might be. If the pages are in reverse order, they're being flipped back around by either CUPS or HPLIP.
Also, are you consistently using the same program to print from? That is to say, Firefox, or LibreOffice? Well, if one of those isn't giving you what you expect, does the other one exhibit the same behavior? That would tell us if it's a driver vs. application issue.
If it looks like I'm spit-balling here... yeah, I am. Sometimes, that's how tech support works. I kind of miss those days, but I'll never again do it for money.
I tried your suggestion, and there was no /var/spool/cups/d00370-001 (or /var/spool/cups/c00370 for that matter).
Okay, I just realized that /var/spool/cups/d00370-001 and /var/spool/cups/c00370 were just examples, so after doing a bit of experimenting, I discovered that I can get LibreOffice to print pages in reverse order (back to front), and in a "roundabout" way, it also works with PDF files, thus saving me the trouble of rearranging the pages after they are printed out.
Well, this hack certainly Works For Me(tm). It's suggested by the LQ "Similar Threads" at the bottom of this page, the same concern on an Ubuntu system. It addresses putting page reversal into CUPS, so that a job's pages come out properly for a "face-up" printer.
CUPS uses various .ppd files to manage the interface between client programs and the printer output generators. The syntax isn't pretty, but if I can grasp it, even on a "script kiddie" level, it's good enough for this comment.
Info: My printer is an HP DeskJet 2130. For my usage pattern, it's very economical. Its PPD is in /etc/cups/ppd/DeskJet_2130.ppd.
Challenge: Can I make CUPS print pages in reverse order, by default?
That Ubuntu "reverse order?" thread suggests adding the line:
Code:
*DefaultOutputOrder: reverse
to the pertinent PPD, but it didn't say exactly where. As I studied the PPD file format, the S/N ratio got lower and lower. With no clear indication of a good spot to insert the line, I decided to just add it at the end, but before the closing comment line that starts with an asterisk and percent-sign, saying "End of hp-deskjet-blah-blah-blah". Maybe that last line terminates parsing, maybe not, but it might in the future.
After I added that line, I re-started cups:
Code:
# /etc/rc.d/rc.cups restart
and then did a strange little thing:
Code:
# echo -e " First page\0014 Second page" | lpr
That "echo" command puts a Form Feed character (ASCII 12, or \0014, or \x0C) into the stream. And what the heck, not only was the Form Feed honored, the pages printed out in the desired reverse order, per the CUPS PPD modification.
One last test was the durability of the file change. Via the web interface, I changed the paper type to "CoatedBrochure", and checked two things: the paper type got changed, but the DefaultOutputOrder was still "reverse". Yep. And then I changed the paper type back to "Plain", and the default output order is still "reverse".
My Slackware CUPS version is -current(ly) 2.3.3.
One final note: That "echo" test ran really slow on the server. Each page took at least lots(*) of seconds to get printed. The same thing happened when I printed from LibreOffice.
(*)Viz. Sir Terry Pratchett's base-4 system, with, many==4 and lots==16.
Sorry, but Okular still prints front-to back no matter how I configure it.
Heh. Even with my hack outlined above, Okular prints in regular order by default. I wonder how it overrides the CUPS PPD configuration?
In any case, I did get Okular to print in reverse order, using the "Options >>" button in the Print window. It adds a tabbed dialog, and one of the options under the first tab is a "Reverse" checkbox. It works for me. It doesn't work for you?
Heh. Even with my hack outlined above, Okular prints in regular order by default. I wonder how it overrides the CUPS PPD configuration?
In any case, I did get Okular to print in reverse order, using the "Options >>" button in the Print window. It adds a tabbed dialog, and one of the options under the first tab is a "Reverse" checkbox. It works for me. It doesn't work for you?
I tried that, too, and it still prints out in front to back order.
The only way that it works for be (as far as PDF files are concerned at least) for printing in reverse order is to use LibreOffice Draw.
Last edited by TheNutCase; 09-15-2020 at 05:48 PM.
I tried that, too, and it still prints out in front to back order.
Then the only explanation I can come up with, is that some library used by Okular has been updated, or the bug somehow got fixed in the Third Slackware Mass Rebuild (released as Slackware-current, April 19, 2018). Oh well.
Then the only explanation I can come up with, is that some library used by Okular has been updated, or the bug somehow got fixed in the Third Slackware Mass Rebuild (released as Slackware-current, April 19, 2018). Oh well.
i finally got Okular to print in back-to-front order. It turned out that all I had to do was to turn my computer off, then turn it back on again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.