[comp.sys.hp] HPGL on the HPLaserjetIII

beamishd@ccvax.ucd.ie (12/10/90)

Can someone please tell me how to print a HPGL file on a hp laserjet 3. I know
that hpgl commands are part of the PCL language but when I send a HPGL file to
the printer it only prints out the command file and not the plot. Any hints,
suggestions or detailed instructions will be gladly welcomed.
							Thanks
Norman Beamish                            
Dept. of Electrical & Electronic Engineering
University College, Dublin
Belfield, Dublin 4
Ireland                                    NBEAME91@irlearn.bitnet
					   NBEAME91@irlearn.ucd.ie
					   beamishd@ccvax.bitnet
  			                   beamishd@ccvax.ucd.ie
	                                  Voice +353-1-693244 Ext.1964
					  Fax   +353-1-830921

ngb@otter.hpl.hp.com (Neal Baker) (12/12/90)

I can only suggest inspecting the codes in the HPGL file.  I personally
know very little about PCL but recently I have been translating it into
a readable form.  The meaning of the codes can be found in an HP publication
"Technical Reference Manual" for the Laserjet printer family,
HP part # 02686-90912, produced by
	Hewlett Packard Company
	Boise Division
	po Box 15
	11311 Chinden Blvd
	Boise
	Idaho 83707

Also the Personal Products Assist line tel.208-323-2551 may help.

I include below a shell script and a sed command file for translating PCL
into a semi-readable form.

Neal Baker
Hewlett Packard Laboratories
Bristol
England

---------------------------------------------------------------------
#
# Translate a file of PCL codes into a sort of printable form on
# standard output.

sed -n -e 'l' $1 > temp
sed -n -f pcl.sed temp

---------------------------------------------------------------------
pcl.sed:

#
# Sed script to convert PCL stream to English.
#

:start
/\n/ b flush

# Join folded lines - remove '\' at eol.
N
s/\\\n//g

# Control:
s/\\33E/--RESET--/g
s/\\33&l.H/--PAGE FEED--/g
s/\\33&f0X/--START MACRO--/g
s/\\33&f1X/--STOP MACRO--/g

# Page format:
s/\\33l0O/\
--PORTRAIT--/g
s/\\33l1O/\
--LANDSCAPE--/g
s/\\33&l\([+-]*[0-9]*\)P/--PAGE LENGTH \1--/g
s/\\33&l\([+-]*[0-9]*\)E/--TOP MARGIN \1--/g
s/\\33&l\([+-]*[0-9]*\)F/--TEXT LENGTH \1--/g
s/\\33&a\([+-]*[0-9]*\)L/--LEFT MARGIN \1--/g
s/\\33&a\([+-]*[0-9]*\)M/--RIGHT MARGIN \1--/g
s/\\339/--CLEAR MARGINS--/g
s/\\33&l\([+-]*[0-9]*\)D/--\1 LINES\/INCH--/g
s/\\33&s0C/--WRAP ON--/g
s/\\33&s1C/--WRAP OFF--/g

# Cursor movement:
s/\\33\*p\([+-]*[0-9]*\)Y\\33\*p\([+-]*[0-9]*\)X/\
--Y \1 DOTS, X \2 DOTS--/g
s/\\33\*p\([+-]*[0-9]*\)Y/\
--Y \1 DOTS--/g
s/\\33\*p\([+-]*[0-9]*\)X/--X \1 DOTS--/g

s/\\33\&a\([+-]*[0-9\.]*\)V\\33\&a\([+-]*[0-9\.]*\)H/\
--Y \1 POINTS, X \2 POINTS--/g
s/\\33\&a\([+-]*[0-9\.]*\)V/\
--Y \1 POINTS--/g
s/\\33\&a\([+-]*[0-9\.]*\)H/{\1}/g

# Raster:
s/\\33\*r0A/\
--START RASTER AT LEFT--/g
s/\\33\*r1A/\
--START RASTER AT CURSOR--/g
s/\\33\*b\([+-]*[0-9]*\)W/\
--RASTER LINE \1--/g
s/\\33\*rB/--END RASTER--/g
s/\\33\*c[0-9]P/\
--FILL REGION--/g

# Font selection:
s/\\33([0-9]*[A-Z]/--FONT--/g

# Translate octal codes that screw up the display:
s/\\[0-7][0-7][0-7]/\|/g

# Flush converted lines - up to '\n'.
:flush
/\n/ {
P
D
}

b start

---------------------------------------------------------------------

larryc@hplvec.LVLD.HP.COM (Larry Corsa) (12/14/90)

Sounds like you haven't got the printer in HP-GL/2 mode.  I believe this is 
accomplished by:

     [ESC]%0B


Regards,

Larry Corsa 

Technical Support Engineer     |  HPDesk address: HP0900/UX 
Measurement Systems Operation  |  HPUX address: larryc@hpisla.lvld.hp.com
815 14th Street SW             |  (303) or TELNET 679-2206 
Mail Stop CU312                |  FAX (303) or TELNET 679-5957
Loveland, CO 80537, USA        |

rer@hpfcdc.HP.COM (Rob Robason) (12/14/90)

You probably need to prepend some escape sequence to the data to get the
printer into plot mode.  That should be documented in the manual.