I'm trying to send a command to open my cash drawer automatically by my application, but without success so far. I contacted the manufacturer of the drawer and printer (non-fiscal) Bematech and they indicated a download with a dll that I have to use and an info file where I have some information that follow below ...
Parameters: Command: STRING with the command you want to execute. Command Size: INTEGER with the size of the command that will be sent.
Example: 'Example in Visual Basic 'Cash Drawer Trigger Command sCommand = chr (27) + chr (118) + chr (140) iRetorno = TxCommand (sCommand, Len (sCommand)
// Example in Delphi // Cash Drawer Triggering Command
s Command: = # 27 + # 118 + # 140; iRetorno: = TxCommand (sCommand, Length (sCommand);
The return of this function is given by an integer value, where if the return is: 1 (one): Success. The function ran smoothly.
0 (zero): Communication error.
But now I have difficulty understanding the logic of how to send this command to the printer for it to open the drawer. Can I submit similar as I send the receipt printing?
Example of how I print ...
insira o código aqui
//--------------------------------Impressão do recibo ---------------------------//
// popular relatório
var report = from p in _objListProduct
select p;
var rpDepartament = new crSaleDepartament();
rpDepartament.SetDataSource(report);
rpDepartament.SetParameterValue("NameUser", _nameUser);
rpDepartament.SetParameterValue("NameDepartament",
//impressão direta do .rpt sem conversão
rpDepartament.PrintToPrinter(1, false, 0, 0);