[comp.fonts] Turbo C and the HP LaserJet II

nzt2305@dsacg2.dsac.dla.mil (Michael L. Spivey) (03/15/91)

From article <1991Mar13.144421.24040@rodan.acs.syr.edu>, by afmintz@rodan.acs.syr.edu (Allan Mintz):
> I was wondering if anyone out there could possibly tell me if there is a
> way to send printer control characters to a HP LJ II with Turbo-C.  Some
> of the output that I am generating will not fit unless it is done using
> compressed print, and I am sick of setting the printer manually each time
> before I run my programs.  Thanks.
> 
> Allan
> 
     I wrote a program to print any user-specified file to a LaserJet II using
any user-specified font.  My program was written in C, but on a UNIX based 
machine.  The differences in what you will have to send via Turbo C are trivial.

     Create a program that would simply include the following line:
  
     printf("%c&l0O%c(0U%c(s0p16.66h8.5v0s0b0T", 27, 27, 27);

     The line above will put your LJ into compressed mode, 16 cpi, 8.5 points,
and portrait mode.  To put the LJ into compressed landscape mode, change the 
first zero in the above printf line to a 1.

     To reset your printer back to all default values, create a program that 
includes the following line:

     printf("%c&l0O%c(1U%c(s0p10h12v0s0b3T", 27, 27, 27):
   
     The line above will put the LJ back to courier 10 pitch, 12 points, portrait orientation.


Michael Spivey
DLA Systems Automation Center
Columbus, Ohio

****************************************************************************
E-mail me at mspivey@dsacg2.dsac.dla.mil for further comments or just to let
me know how it worked.
****************************************************************************