HP (Hewlett-Packard) IIISI Printer User Manual


 
#include <stdio.h>
#include <fcntl.h>
#define MONTH "\214\216"
#define TILDE "\201\140"
#define DAY "\223\372"
#define CLUSTER "\201\100\033&f0S\033&a0P%s%d\033&a270P\033&f1S"
FILE *prn;
main()
{
int point_size=24;
int offset;
char OFFSET[40];
prn = fopen("lpt1","wb"); /* open lpt1 for writing */
offset = ( 36 * point_size * 300) /
/* ---- ---------- */
( 256 * 72 );
sprintf(OFFSET,"\33*p-%dx-%dY",offset,offset); /* used to
place cluster */
fprintf(prn,"\33%%-12345X"); /* send UEL to get to PJL */
fprintf(prn,"@PJL ENTER LANGUAGE=PCL\n"); /* Enter PCL */
fprintf(prn,"\33E"); /* Esc E to reset printer */
fprintf(prn,"\33&t31P"); /* text parsing = Shift-JIS */
fprintf(prn,"\33(19K"); /* symbol set = Win3.1J */
fprintf(prn,"\33&a270P"); /* print direction = 270 */
fprintf(prn,"\33*p500x1300Y"); /* set CAP position */
fprintf(prn,"\33(s1p%dv0s0b28752T",point_size); /* MS-Mincho */
fprintf(prn,"\33&c-1T"); /* select vertical writing mode */
fprintf(prn, CLUSTER MONTH, OFFSET, 11); /* print month */
fprintf(prn, CLUSTER DAY, OFFSET, 16); /* print day */
fprintf(prn, TILDE); /* print tilde */
fprintf(prn, CLUSTER MONTH, OFFSET, 11); /* print month */
fprintf(prn, CLUSTER DAY, OFFSET, 17); /* print day */
fprintf(prn,"\f"); /* formfeed */
fprintf(prn,"\33%%-12345X"); /* send UEL to get to PJL */
}
Printer-Specific Differences 2-59