HP LaserJet 4100 HP PCL/PJL reference (PCL 5 Printer Language) - Technical Ref - Page 16
Example:C Programming Language, Initialize HP-GL/2 Mode
View all HP LaserJet 4100 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 16 highlights
Example:C Programming Language This example uses the C programming language to print the same three lines shown on the previous page. Table 17-6 #include main() { FILE *prn; prn = fopen("PRN","wb"); fprintf(prn,"033E"); fprintf(prn,"033%%>0B"); /* open the printer */ /* E C E to reset printer */ /* Enter HP-GL/2 */ fprintf(prn,"IN"); /* Initialize HP-GL/2 Mode */ fprintf(prn,"SP1PA10,10"); /* Select pen 1 & move to 10,10 */ fprintf(prn,"PD2500,10,10,1500,10,10;"); /* Pen down & draw */ fprintf(prn,"033%%0A"); /* enter PCL at previous CAP */ fprintf(prn,"033E"); /* Reset to end job/eject page */ } 17-14 An Introduction to HP-GL/2 Vector Graphics EN
17-14
An Introduction to HP-GL/2 Vector Graphics
EN
Example:C Programming Language
This example uses the C programming language to print the same
three lines shown on the previous page.
Table 17-6
#include <stdio.h>
main()
{
FILE *prn;
prn = fopen(“PRN”,“wb”);
/* open the printer */
fprintf(prn,“033E”);
/*
E
C
E to reset printer */
fprintf(prn,“033%%>0B”);
/* Enter HP-GL/2 */
fprintf(prn,“IN”);
/* Initialize HP-GL/2 Mode */
fprintf(prn,“SP1PA10,10”);
/* Select pen 1 & move to 10,10 */
fprintf(prn,“PD2500,10,10,1500,10,10;”);
/* Pen down & draw */
fprintf(prn,“033%%0A”);
/* enter PCL at previous CAP */
fprintf(prn,“033E”);
/* Reset to end job/eject page */
}