====================
HPIR Virtual Printer
====================

This package simulates the HP82240A and HP82240B printers, making PDF files from the output of a
HP calculator. Also includes a blue monochrome virtual printer with Euro character for HP 49/50G.


REQUIREMENTS
------------

- A Linux server with these packages installed:

	a2ps
	ghostscript
	perl
	samba

- HP82240B Printer Simulator by Cristoph Giesselink, and any compatible emulator/calculator.


INSTALLATION ON LINUX
---------------------

1. SETUP a2ps

Log in as root to uncompress hpir-vprinter*.zip from the root directory. You need:

	/usr/share/a2ps/encoding/iso1e.edf
	/usr/share/a2ps/sheets/hpir-a.ssh
	/usr/share/a2ps/sheets/hpir-b.ssh
	/usr/share/a2ps/sheets/hpir-g.ssh
	/usr/share/a2ps/sheets/hpir.ssh
	/usr/share/a2ps/ps/hp-a.pro
	/usr/share/a2ps/ps/hp-b.pro
	/usr/share/a2ps/ps/hp-g.pro

Edit /usr/share/a2ps/encoding/encoding.map to add the Euro character:

	########################################################################
	# The ISO encodings
	########################################################################
	iso1e			iso1e

	...

2. SETUP ghostscript (OPTIONAL)

Edit /usr/share/ghostscript/X.XX/lib/gs_statd.ps (where X.XX is the current version), to set the
paper dimensions, or you can use other format (A4, A5, letter). Insert a "roll" 80 mm wide 279 mm
long, and another one 57 mm wide 216 mm long:

	/.setpagesize ...

	 /roll80 {225 792 //.setpagesize exec} bind def
	 /roll57 {162 612 //.setpagesize exec} bind def
	%END SIZES

And below:

	/.pagetypenames ...

	   /roll80 /roll57
	%END SIZES

To use e.g. A4 instead of those formats, substitute a4 for roll80 and roll57 in file:

	/usr/local/sh/hpir

3. ADD PRINTERS TO SAMBA

Append three printers to /etc/samba/smb.conf:

	[iso1e]
		comment = HP ISO 8859-1+Euro
		path = /var/spool/samba
		printable = Yes
		print command = /usr/local/sh/hpir -g iso1e %U '%J'
		browseable = Yes

	[ecma94]
		comment = HP 82240B ECMA-94
		path = /var/spool/samba
		printable = Yes
		print command = /usr/local/sh/hpir -b iso1 %U '%J'
		browseable = Yes

	[hp8]
		comment = HP 82240A/B Roman8
		path = /var/spool/samba
		printable = Yes
		print command = /usr/local/sh/hpir -a hp8 %U '%J'
		browseable = Yes

Restart the smb service.


USAGE
-----

Configure the Samba printers on your Windows system with driver "Generic / Text Only".

Launch HP82240B Printer Simulator and print from any emulator (Emu48, Emu42) or through a serial
port. Then choose one of them for text:

	iso1e   for HP 49/50
	ecma94  for HP 48
	hp8     for HP 42/28

Data (text & graphics) can be saved to a file and sent to the remote printers:

	copy /b FILE.bin \\SAMBA_SERVER\iso1e

	copy /b FILE.bin \\SAMBA_SERVER\ecma94

	copy /b FILE.bin \\SAMBA_SERVER\hp8

Or maybe you prefer to associate the .bin extension to a windows shell command for the context menu
and send the file to the queues using the mouse. In that case, bin.reg should be copied, modified to
set the name of your SAMBA_SERVER, and executed to install in the registry.

A PDF file will be created into the HOME directory of the Linux user.


NOTES FOR THE CALCULATOR
------------------------

To get several pages, print the character 12 (Form Feed):

	12
	CHR
	PR1

After printed graphics from HP 28, make sure to send 27 248 before printing text:

	27
	CHR
	248
	CHR
	+
	PR1


ESCAPE SEQUENCES
----------------

To test the virtual printers the following sequences are available:

	28 254		Character Set
	28 255		Extended Features

And new faces:

	28 253		Start Superscript / Italic (ECMA-94 & ISO 8859-1+Euro)
	28 252		Stop Superscript / Italic (ECMA-94 & ISO 8859-1+Euro)
	28 251		Start Subscript / Proportional (ECMA-94 & ISO 8859-1+Euro)
	28 250		Stop Subscript / Proportional (ECMA-94 & ISO 8859-1+Euro)
	28 249		Start Emphasized
	28 248		Stop Emphasized


This software is distributed under the GPL License v3.
(C) Miguel A. Regao, 2026
