serial port printer sending commands, how?
hi guys,
i have a serial port printer and i want to print on it. Im using QPrinter and QTextDocument.print to print (it prints) but however the printer have some necessary commands for example autocut that need to be inputed e.g("\x1D\x56\x01"). What class should i use to send the command? and also until now im printing the file as a whole, how can i print it line by line so that i can change the font size of some line or bold some words.
thanks in advance..
Re: serial port printer sending commands, how?
If you use QTextDocument then you should perform all the changes in the document and not while printing.
If you want to print line by line, you have to open the serial port and act as the printer driver sending raw commands through the serial.
Re: serial port printer sending commands, how?
how can i open the port? what class should i use and how do i send commands on it?
Re: serial port printer sending commands, how?
Either use QExtSerialPort which you can download from web or use native API. With so fine grained control requirement that might be the best option.