This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Linux / UNIX and the fly likes Setting printer paper length using unix commands Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Setting printer paper length using unix commands" Watch "Setting printer paper length using unix commands" New topic
Author

Setting printer paper length using unix commands

karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 110

Hi Guys,
I have been trying to resolve a printing problem but nothing works out .
I have an Epson LQ 680 (dot matrix printer) . I need to print a file . The paper length should be 34 .Left margin should be 5. I have tried the following things after researching from the man pages.




But in both these cases i get a problem where in the first page is printed properly but the second page and pages after spits out blank lines and it doesn't obey the page length .
My other case was

where form feed characters are read properly and aligned but the printer takes default length of paper size as 66. I need to override this paper length settings through shell script whenever i print.
Since other applications use the same printer i can't set the page size in the server .

I am using HP - UX , Bourne Shell.

I heard that we can echo the printer settings in unix.I have the printer codes in Hexa decimal values. (\x1B\x43\x21)

Have tried using


But nothing is working.I am a newBee to Unix .

Any help on how to echo the printer page length dynamically using any unix commands .


"Learning is a Culture where your Eagerness & Curiosity plays a major Role".
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

If you're using a continuous-form (fan-fold) printer - which it certainly sounds like you are - you are very likely running into a conflict between printer options and OS options on page length.

A lot of printers featured an automatic skip-over-perforation function designed to permit printing long continuous sets of lines while automatically jumping over the perforated section where you tear pages apart, since otherwise you'd end up with half a line on one page and the other half of the line on another page.

So if the OS is attempting to manage the page size AND the hardware (printer) is attempting to manage page size, chaos is the outcome.

Fortunately, the skip-over-perf option can usually be be switched off by adding the appropriate control sequence to the printed output. Or occasionally by running a software or hardware utility (in some cases, flipping a DIP switch on the printer). That's vendor-dependent, so consult the printer's instruction manual.


Customer surveys are for companies who didn't pay proper attention to begin with.
karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 110

Tim,
Thanks for the reply. Have tried that option. Still i'm getting the same issue. Any other possible solutions through Unix ?
karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 110

Tim,

I have tried using this following echo commands .



I am really not sure about this syntax since it did not reflect any changes in my printing. Have browsed google but was not able to find any type of examples for this.

Have tried the following.



How should i echo the printer codes to the printer from Unix. Whether i need to echo the printer codes to ?




 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting printer paper length using unix commands