To: eliz AT is DOT elta DOT co DOT il Cc: vmccar AT juno DOT com, djgpp AT delorie DOT com Subject: Re: Need help with printer Message-ID: <19990615.105120.10271.0.vmccar@juno.com> References: X-Mailer: Juno 1.49 X-Juno-Line-Breaks: 0-17,19-88,90-106 From: Vince McCarthy Date: Tue, 15 Jun 1999 13:50:45 EDT Reply-To: djgpp AT delorie DOT com Thank you Eli for you response. Below is a small summary of the Printer commands for a Panasonic Dot-matrix printer. (Print Quality) Quality and Pitch: Name: ESC 1 n Dec: 27 73 n Hex: 1B 49 n n are the different draft and Lq sizes. Draft cpi's, 0=10 CPI, 8=12 CPI, 16=17 CPI, these are draft only. (Selects LQ typeface.) Typeface: Name: ESC 1 n Dec: 27 73 n Hex: 1B 49 n n = 0=Roman, 1=Sanserif, 2=Courier, 3=Prestige, and 4=Script fonts. Typeface must be reselected after any pitch change. This is the codes I have tried but have not had any luck, except the printer does change fonts, but once set, the printer cannot go back to draft quality or any other mode. These are the functions I have tried. PrintDraft(int Pitch) { if (Pitch == 0) { /* Internal draft 10 CPI mode */ fprintf(stdprn,"\x1B \x1b\x49 \x1B\x00"); } return 0; } TypeFace(int Font) { if (Font == 1) { /*--- Sanserif ---*/ fprintf(stdprn,"\x1B \x1b\x6B \x1B\x01"); } return 0; } PrinterReset() { fprintf(stdprn, "\x1B \x1B\x40"); fprintf(stdprn, "\x1B \x1B\x32"); return 0; } main() { unsigned short Pitch, Font; /* run at draft 10 CPI, initial turn on */ fprintf(stdprn, "Test 1 for DJGPP system Draft printing\n"); /* set up printer for 10 CPI Courier Font */ Pitch = 0; /* internal draft 10 CPI mode */ PrintDraft(Pitch); /* set to Courier Typeface */ Font = 2; /* Courier Typeface */ TypeFace(Font); fprintf(stdprn, "Test 2 for DJGPP system Courier printing\n"); Pitch = 2; /* internal LQ 10 CPI mode */ PrintDraft(Pitch); Font = 4; /* Script Typeface */ TypeFace(Font); /* set for 10 CPI Script */ fprintf(stdprn, "Test 3 for DJGPP system Script printing\n"); return 0; } The result is the font changes to Courier from draft but will not change to script. It stays in the Courier font. The only way to clear the printer is to cycle the power. This is just a sample of the commands for the Panasonic printer but the rest commands are similar. I hope the above information will be of help, the command fprintf(":Lpt1", "command string"); was typing error (sorry). Thank you Vince McCarthy. On Tue, 15 Jun 1999 10:00:28 +0300 (IDT) Eli Zaretskii writes: > >On Mon, 14 Jun 1999, Vince McCarthy wrote: > >> I have used the commands `fprintf(stdprn, "string")' and >also ` >> fprintf(":lpt1", "command string")' > >Please give us some information with which to begin helping you. A >short complete test program that should have printed something, and a >description of what happens when you actually run it on your machine, >would be a good beginning. It is impossible to help you without >looking at the code you tried to use. > >Btw, the second line above, fprintf(":lpt1", "command string"), is >certainly wrong, since the first argument to fprintf should be a >stream, not a file name. But using stdprn should work. ___________________________________________________________________ Get the Internet just the way you want it. Free software, free e-mail, and free Internet access for a month! Try Juno Web: http://dl.www.juno.com/dynoget/tagj.