CHAPTER 1 INTRODUCTION - 4
2.
AREAS OF USE
There are several different applications for which you may want to use your HL-Series printer. Four general
areas are outlined in the following sections.
2.1
Using Word Processing Packages and Spreadsheets
You may simply wish to use the printer with your software application packages, such as word-processors or
spreadsheets. Many software packages automatically send commands to the printer requesting particular type
styles, character sizes and specifying page set-up information and other relevant data. In this case you will
not need to use this manual, as your software package will perform the task of controlling the printer for you.
Other packages allow you to embed software commands within your word-processed or spreadsheet
documents. This manual describes the commands you need, and you can simply include them in the form
that your package requires. In either case, read the documentation that came with your software to find out
its own specific requirements for driving a printer.
2.2
Graphics
HP-GL/2 or HP-GL mode offers many powerful graphic features that enable you to draw and print detailed
images quickly and easily. Many commercial graphic packages, notably computer-aided design applications
programs, produce HP-GL/2 or HP-GL output. LaserJet mode also has several graphics features. You can
either write your own programs to generate images or use existing graphics software.
2.3
Programming
If you are writing software, for example in BASIC or C, to drive the printer, the description and formal
specification of each command will enable you to transcribe them straight into your programs. Below is a
simple example of a program to draw and print a three inch black square. The program is given in both C
and BASIC.
C language program
#include <stdio.h>
main()
{
FILE *prn; /* initialization section */
prn = fopen("PRN","wb");
fprintf(prn,"\33E"); /* Esc E - Reset the printer */
fprintf(prn,"\33%0B"); /* Esc%0B - Enter HP-GL/2 */
fprintf(prn,"IN"); /* Initialize */
fprintf(prn,"SP1PA1024,1024"); /* Select pen 1 & move to 0,0 */
fprintf(prn,"PDFT1RA4096,4096"); /* Draw 3" solid square */
fprintf(prn,"\33%0A"); /* Quit HP-GL/2 & restore original cursor
position */
fprintf(prn,"\33E /* Reset and eject page */
}
BASIC language program
10 LPRINT CHR$(27);"E"; :REM Esc E - Reset the printer
20 LPRINT CHR$(27);"%0B"; :REM Esc%0B - Enter HP-GL/2
30 LPRINT "IN"; :REM Initialize
40 LPRINT "SP1PA1024,1024"; :REM Select pen 1 & move to 0,0
50 LPRINT "PDFT1RA4096,4096"; :REM Draw 3" solid square
60 LPRINT CHR$(27);"%0A"; :REM Quit HP-GL/2 & restore original cursor
position
70 LPRINT CHR$(27);"E"; :REM Reset and eject page
Summary of Contents for HL-4140CN
Page 4: ......
Page 15: ...CHAPTER 1 INTRODUCTION 1 CHAPTER 1 INTRODUCTION ...
Page 20: ...CHAPTER 2 PCL 1 CHAPTER 2 PCL PRINTER CONTROL LANGUAGE ...
Page 137: ...CHAPTER 3 PCL5C 1 CHAPTER 3 PCL5C ...
Page 155: ...CHAPTER 4 HP GL 2 1 CHAPTER 4 HP GL 2 GRAPHICS LANGUAGE ...
Page 208: ...CHAPTER 5 PJL 1 CHAPTER 5 PJL PRINTER JOB LANGUAGE ...
Page 285: ...CHAPTER 6 EPSON 1 CHAPTER 6 EPSON FX 850 ...
Page 313: ...CHAPTER 7 IBM PROPRINTER 1 CHAPTER 7 IBM PROPRINTER XL ...
Page 334: ...CHAPTER 8 BAR CODE CONTROL 1 CHAPTER 8 BAR CODE CONTROL ...
Page 346: ...CHAPTER 9 HP GL 1 CHAPTER 9 HP GL GRAPHICS LANGUAGE ...
Page 373: ...CHAPTER 10 CARBON COPY FUNCTION 1 CHAPTER 10 CARBON COPY FUNCTION ...
Page 383: ...APPENDIX A COMPARISON LIST 1 APPENDIX A COMPARISON LIST ...
Page 490: ...APPENDIX C HBP MODE COMMANDS 1 APPENDIX C HBP MODE COMMANDS For HL 820 1020 1040 Only ...