LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   CUPS Problem in Linux (lp) (https://www.linuxquestions.org/questions/linux-software-2/cups-problem-in-linux-lp-4175609706/)

ShadyBAB 07-12-2017 01:27 PM

CUPS Problem in Linux (lp)
 
2 Attachment(s)
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

ferrari 07-12-2017 04:44 PM

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

ShadyBAB 07-12-2017 05:02 PM

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

ferrari 07-12-2017 05:35 PM

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/*

ShadyBAB 07-12-2017 06:16 PM

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

ferrari 07-12-2017 06:53 PM

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?

ShadyBAB 07-13-2017 10:20 AM

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??

ferrari 07-13-2017 03:27 PM

Quote:

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


All times are GMT -5. The time now is 04:35 PM.