Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing to lpt1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
The following code works but, to my dismay, the 1st fprintf command prints to a thermal transfer printer label and then form feeds before the barcode (from the 2nd fprintf command) prints. How can I print both the text and barcode to the same label?
/* DMX SERIES C program */

# include "stdio.h"

main ()
{
FILE *fp = fopen("LPT1", "w");

char *pcs = "123456";
char *desc = "123456";

/* STX L - Enter Label Formatting */
fputs ("\x02L\n", fp);
/* Enter Heat Setting of 7 */
fputs ("H07\n", fp);
/* Set Width and Height Dot Size */
fputs ("D95\n", fp);

/* Select smooth Font */
fprintf (fp,"191108010000025%s\n",desc);

/* Select Barcode type ‘a’ */
fprintf (fp, "2A6220005750050%s\n", pcs);
/* End Label format mode and print */
fputs("E\n",fp);
fclose(fp);
}


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top