LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-12-2017, 01:27 PM   #1
ShadyBAB
LQ Newbie
 
Registered: Jul 2017
Posts: 4

Rep: Reputation: Disabled
CUPS Problem in Linux (lp)


Hello Linux Questions!

First off I want to point out that I am somewhat new to Linux printing

My Problem is I am converting a shell script from HP-UX that is printing two landscape pages per page on one portrait page like this:

-------------------
||---------------||
|| ||
|| Page 1 ||
|| ||
||---------------||
||---------------||
|| ||
|| Page 2 ||
|| ||
||---------------||
-------------------

The HP-UX command is:
lp -dPrinter -olandscape -ohalf -oduplex FileToPrint.txt


I tried the following in Linux:
lp -olandscape -ofit-to-page -oorientation-requested=3 -osides=two-sided-short-edge -opage-border=single -onumber-up=2 FileToPrint.txt

But the result I am getting is:

-------------------
||---------------||---
|| || |
|| Page 1 || |
|| || |
||---------------||---
||---------------||---
|| || |
|| Page 2 || |
|| || |
||---------------||---
-------------------

It almost as if it seems the Fit-to-page option isn't working..

Any advice? I've tried several variations but I keep getting the same result

Thank you in advance
Attached Thumbnails
Click image for larger version

Name:	ExpectedResult.png
Views:	10
Size:	2.3 KB
ID:	25457   Click image for larger version

Name:	Error.png
Views:	9
Size:	2.5 KB
ID:	25458  

Last edited by ShadyBAB; 07-12-2017 at 01:57 PM.
 
Old 07-12-2017, 04:44 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,231

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
Just a guess from me. Could this be a paper size issue perhaps? You could try specifying the media size explicitly eg
Code:
-o media=legal
 
Old 07-12-2017, 05:02 PM   #3
ShadyBAB
LQ Newbie
 
Registered: Jul 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Ok that seemed to help, however I need it to print to letter sized paper. When I put -o media=letter. I have the same problem I began with. I also tried media=Custom.8.5x11in but still same issue
 
Old 07-12-2017, 05:35 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,231

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
I'm not sure if it is case sensitive, it might need to be 'media=Letter'.
https://www.cups.org/doc/options.html

I guess you could experiment with the custom dimensions a bit.

Also, I'm not sure if the printer PPD DefaultPaperDimension and DefaultPageSize variables will influence the outcome at all, but worth checking I guess...
Code:
grep "Default" /etc/cups/ppd/*

Last edited by ferrari; 07-12-2017 at 05:37 PM.
 
Old 07-12-2017, 06:16 PM   #5
ShadyBAB
LQ Newbie
 
Registered: Jul 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
I tried -o media=letter and same issue

I'll mess around with like -o cpi and stuff, but I wonder if there is an equivalent option to "half" in Unix in Linux
 
Old 07-12-2017, 06:53 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,231

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
The standard options are detailed in CUPS page I linked to. (Other printer-specific options that may be available can be got from the lpoptions command.)


Quote:
Scaling to Fit

The -o fit-to-page option specifies that the document should be scaled to fit on the page:

lp -o fit-to-page filename
lpr -o fit-to-page filename

The default is to use the size specified in the file.

Note:

This feature depends upon an accurate size in the print file. If no size is given in the file, the page may be scaled incorrectly!
I still wonder if examination of the printer PPD might be helpful here?
 
Old 07-13-2017, 10:20 AM   #7
ShadyBAB
LQ Newbie
 
Registered: Jul 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
I tried:

lp -olandscape -omedia=letter -ofit-to-page -osides=two-sided-short-edge -opage-border=single -onumber-up=2 PET64024P.6889932

But same result. Really hoped that would work. I wonder if order of the options matters??
 
Old 07-13-2017, 03:27 PM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,231

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
Quote:
I wonder if order of the options matters??
No, it shouldn't. A bug report may be needed.
 
  


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
Problem in Xerox Printer configuration in linux with CUPS Lakki Red Hat 1 04-26-2010 07:26 AM
CUPS problem - connecting to local printer as well as CUPS server bobm2011 Linux - Newbie 4 01-11-2010 07:28 AM
Problem running CUPS with CUPS 1.4b2 beta hikerguy Linux - Software 3 01-18-2009 01:57 AM
problem printing on linux with cups on Fedora Core 6 Moore Linux - General 2 08-01-2007 04:12 AM
Printing Problem (cups / cups-lpd) daleman Linux - Software 3 04-08-2005 08:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:25 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