Hi.
Here is my code.
var deviceAddress = _preferences.GetBluetoothDevice();
var result = new PrintResult();
if (string.IsNullOrEmpty(deviceAddress))
{
result.Result = PrintResultTypes.PrinterNotFound;
return Task.FromResult(result);
}
var connectionFactory = ZebraPrinterFactory
.GetInstance(PrinterLanguage.ZPL, ConnectionBuilder.Build($"BT:{deviceAddress}"));
try
{
connectionFactory.Connection.Open();
connectionFactory.Connection.Write(Encoding.UTF8.GetBytes(text));
}
finally
{
if (connectionFactory.Connection?.Connected == true)
connectionFactory.Connection.Close();
}
return Task.FromResult(result);
On the "connectionFactory.Connection.Write(Encoding.UTF8.GetBytes(text));", text is an zpl code like this.
^XA
^FX Tabela de dados
^FX Box externo da etiqueta
^FT030,250^GB750,240,2,B,0^FS
^FX Linha divisória horizontal Cidade/Cliente
^FT030,090^GB750,001,2,B,0^FS
^FX Linha divisória horizontal Cliente/Chassi
^FT030,170^GB750,001,2,B,0^FS
^FX Linha divisória vertical Cidade/Minuta
^FT620,090^GB001,080,2,B,0^FS
^FX Linha divisória vertical Chassi/NF
^FT450,250^GB001,080,2,B,0^FS
^FX Títulos dos boxes
^FT040,030^A0L,017,019^FDCidade^FS
^FT040,110^A0L,017,019^FDCliente^FS
^FT040,190^A0L,017,019^FDChassi^FS
^FT770,030,1^A0L,017,019^FDMinuta^FS
^FT770,190,1^A0L,017,019^FDNota Fiscal^FS
^FX Dados da etiqueta
^FT040,080,0^A0L,060,035^FD@CidadeDoDestinatario@^FS
^FT040,160,0^A0L,055,030^FD@Destinatario@^FS
^FT040,240,0^A0L,060,045^FD@CodigoRastreabilidade@^FS
^FT770,080,1^A0L,050,040^FD@CodigoExternoRecebimento@^FS
^FT770,240,1^A0L,050,045^FD@NotaFiscalEntrada@-@NotaFiscalSerieEntrada@^FS
^FX Barcode
^FT170,320^FB850,1,0,C^BY3^BCN,60,Y,N,Y^FD@CodigoDeBarras@^FS
^XZ
When we send this code to an zebra printer ZQ520, it prints the label correctlly, but the printer does not "finish" the label correctly.
Our labels are "media gap" type and after printer, the label stops around 3mm before the gap. (see the attached image)
We think it could be two options:
1: There is a misconfiguration on printer, or label.
2: The c# code is sending a command of countinuous printing, and it is changing the Gap Mode.
My question.
Is this code Ok?
Is there any change that need to be done?
Thanks a lot!!!
Is my code sending a continuation code? |
1 Replies
Hello Jedielson,
It looks like your ZPL code has incorrect sizes somewhere. I think the issue is related to ZPL code only.I don’t know the size of your labels. You can try to debug your ZPL code using online viewer: ZPL Viewer
Alexander PalchikovSoftware Engineer, Kutir MobilityPosted on behalf of Zebra Technologies