Computing.Net > Forums > Programming > printing to lpt1 using C

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

printing to lpt1 using C

Reply to Message Icon

Name: Weston Gaddis
Date: July 31, 2002 at 10:31:43 Pacific
Comment:

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

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

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

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

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

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



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Declairation Of Socket In... about Interrupt



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: printing to lpt1 using C

C/C++ Windows printing example www.computing.net/answers/programming/cc-windows-printing-example/13808.html

Writing directly to LPT1... www.computing.net/answers/programming/writing-directly-to-lpt1/4775.html

Printing Line directly to printer -VB6 www.computing.net/answers/programming/printing-line-directly-to-printer-vb6/2223.html