MSComm Printing

F

Thread Starter

froilanserohijos

I am using <b>MSComm Control</b> to send data to print in <i>Com1 (Bixolon Thermal Printer)</i>. I have an issue regarding controlling my Font Face and Font Size. Is their any way to control it?

Below is my sample code Only a portion of how can I print TEST to the Thermal printer using Com1 and VB6 Program. This code works but only I want to change font face and size:<pre>
MSComm1.CommPort = 1
If MSComm1.PortOpen <> True then
MSComm1.PortOpen = True
else
MSComm1.PortOpen = False
end if

MSComm1.Output = "TEST"
MSComm1.PortOpen = False</pre>
 
I am only somewhat familiar with the MSCOMM activeX control but I do know that it is a serial data stream and has no knowledge of printing. You will have to set up fonts on your printer hardware or figure out if it accepts certain control codes and/or a custom ASCII protocol to change fonts programmatically.

BTW, if you aren't stuck using VB6 please upgrade to a more modern serial port API such as the one included with C#.NET and VB.NET. There are many examples online for how to use this control.

KEJR
 
D

DixitSolanki

This code will not set any Font to your Printer. This code will only pass the Message to be print.

You need to look Technical datasheet of your thermal printer. You need to look for, How to change the Font.

If there is a provision to change Fonts via Serial port, then you have to follow the description for changing the Font & accordingly you need to do coding in VB.

-Dixit Solanki
 
Top