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”);

/* EC 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 */

}

 

17-14An Introduction to HP-GL/2 Vector Graphics

EN

Page 384
Image 384
HP 5961-0509 manual ExampleC Programming Language, 17-14An Introduction to HP-GL/2 Vector Graphics