• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Setting printer paper length using unix commands

 
Ranch Hand
Posts: 126
1
Oracle Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Bartender
Posts: 21004
128
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
karthik Suryanarayanan
Ranch Hand
Posts: 126
1
Oracle Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 126
1
Oracle Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?




 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!