#!/perl/bin # This tiny perl script provides a solution for the following problem: # You have an existing document covering several pages. You wish to print additional information # on each page, like Page numbering, Author text, etc. # You can use this script as template and apply changes when needed. Please send mail if you # thought this was useful for you. (Kajetan@Hinner.com) # In this current version only HP PCL printers (i.e. Laserjet 5L) are supported. # # written by Kajetan Hinner, Sociology Dep., Univ. of Rostock, Germany, July 1998. Version: 0.1 #usage: perl printpagenumber.pl > test # cat test > /dev/lp0 # # the first command creates an output file "test" which contains all the printer statements # the 2nd command copies this file to your parallel port (my printer is connected to lp0, if # yours is tp lp1, then change this. my $counter = 0; my $i; print ("\e%-12345X\@PJL COMMENT Kajetan Hinner\n"); print ("\@PJL SET IOBUFFER=AUTO\n"); print ("\@PJL SET IOBUFFER=AUTO\n"); # Those PJL commands were taken from a pcl-file print ("\@PJL SET RESOLUTION=600\n"); # of a wordprocessor. those settings may only be print ("\@PJL SET PAGEPROTECT=AUTO\n"); # usefule for LaserJet 5L printers print ("\@PJL SET RET=ON\n"); print ("\@PJL SET IMAGEADAPT=AUTO\n"); print ("\@PJL SET ECONOMODE=OFF\n"); # All the PCL commands were looked up at www.hp.com print ("\@PJL SET DENSITY=3\n"); print ("\@PJL ENTER LANGUAGE=PCL\n"); print ("\e&l26A"); # DIN A4 paper select #print ("\e&l3A"); # LEGAL format print ("\e&l0O"); # Orientation: Portrait print ("\e\x280N"); # Select symbol set: ISO 8859-1 print ("\e\x28s1S"); # italic print ("\e\x28s16901T"); # Times New Roman print ("\e\x28s1P"); # Proportional font # print ("\e\x28s12H"); # Characters / inch print ("\e\x28s10V"); # Primary height (18 Points) while ($counter++ < 150) { # for ($i=0; $i<20; $i++) { print ("\n") }; print ("\e*p3280Y"); # Vertical Position (100 Dots) print ("\e*p10X"); # horizontal position (10 Dots) print ("P.Preisendörfer, Einführung in die Methoden und Techniken der empirischen Sozialforschung, Teil I. S. $counter\f"); }