LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-11-2020, 01:48 PM   #1
TheNutCase
Member
 
Registered: May 2016
Location: Columbia, South Carolina14
Distribution: Slackware 14.2
Posts: 414

Rep: Reputation: Disabled
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?
 
Old 09-11-2020, 06:25 PM   #2
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 351

Rep: Reputation: Disabled
First things first:

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?
 
Old 09-11-2020, 07:29 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 16,566
Blog Entries: 27

Rep: Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024
Also, are you using HPLIP?
 
Old 09-12-2020, 11:50 AM   #4
TheNutCase
Member
 
Registered: May 2016
Location: Columbia, South Carolina14
Distribution: Slackware 14.2
Posts: 414

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gus3 View Post
First things first:

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).

And yes, I'm using HPLIP.
 
Old 09-12-2020, 07:30 PM   #5
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 351

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 09-12-2020, 08:52 PM   #6
TheNutCase
Member
 
Registered: May 2016
Location: Columbia, South Carolina14
Distribution: Slackware 14.2
Posts: 414

Original Poster
Rep: Reputation: Disabled
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).
 
Old 09-13-2020, 12:12 PM   #7
TheNutCase
Member
 
Registered: May 2016
Location: Columbia, South Carolina14
Distribution: Slackware 14.2
Posts: 414

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gus3 View Post
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).
 
Old 09-13-2020, 01:13 PM   #8
TheNutCase
Member
 
Registered: May 2016
Location: Columbia, South Carolina14
Distribution: Slackware 14.2
Posts: 414

Original Poster
Rep: Reputation: Disabled
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.
 
Old 09-13-2020, 04:52 PM   #9
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 351

Rep: Reputation: Disabled
How about Okular? Any luck there?
 
Old 09-13-2020, 06:36 PM   #10
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 351

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 09-14-2020, 03:43 PM   #11
TheNutCase
Member
 
Registered: May 2016
Location: Columbia, South Carolina14
Distribution: Slackware 14.2
Posts: 414

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gus3 View Post
How about Okular? Any luck there?
Sorry, but Okular still prints front-to back no matter how I configure it.
 
Old 09-14-2020, 04:40 PM   #12
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 351

Rep: Reputation: Disabled
Quote:
Originally Posted by TheNutCase View Post
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?
 
Old 09-15-2020, 05:41 PM   #13
TheNutCase
Member
 
Registered: May 2016
Location: Columbia, South Carolina14
Distribution: Slackware 14.2
Posts: 414

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gus3 View Post
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.
 
Old 09-15-2020, 07:38 PM   #14
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 351

Rep: Reputation: Disabled
Quote:
Originally Posted by TheNutCase View Post
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.
 
Old 09-16-2020, 10:57 AM   #15
TheNutCase
Member
 
Registered: May 2016
Location: Columbia, South Carolina14
Distribution: Slackware 14.2
Posts: 414

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gus3 View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can I set the cups output order to always print in reverse order Thane Ubuntu 3 07-09-2018 09:49 PM
Logi Sales Manager on Ncurses (invoice, invoicing, orders, order, sale order, sales order...)? Xeratul Linux - Software 0 03-25-2017 02:45 PM
Get first day of last month and last day of last month in bash xowl Linux - Software 18 02-09-2017 09:49 AM
CUPS - print pages in reverse order satinet Slackware 10 02-15-2010 01:38 PM
Setting CUPS to print the first page last (reverse) DanielCox Linux - Hardware 1 02-04-2007 05:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration