Our app prints directly to a Zebra UPS printer (Zebra GK420d). The list of printing commands are formatted as expected by the ExtEscape (Zebra Printer direct communication).
Printing works as expected on the local machine with the USB printer attached however nothing gets printed when using the app from a remote machine via remote desktop. All computers are running Windows 10 with latest updates.
A test was done sending the following commands from the local and remote machine while the printer is paused:
^FX
^XA
^LH30,30
^FO20,10
^ADN,18,20
^FDTest^FS
^XZ
It is possible to print the above commands correctly from the remote machine if saving it to a file and copying the file to \\printer_name.
The following is the method used to print the commands that are passed as a string argument:
procedure SendCommandsToPrinter(ACommands: string);
var
FmtLabel: AnsiString;
begin
FmtLabel := '00' + AnsiString(ACommands);
PWord(FmtLabel)^ := Length(FmtLabel) - 2; // store the length
Printer.BeginDoc;
if ExtEscape(Printer.Canvas.Handle, PASSTHROUGH, Length(FmtLabel), Pointer(FmtLabel), 0, nil) <= 0 then
raise Exception.Create('Printer error');
Printer.EndDoc;
end;
The spooled files generated on C:\Windows\System32\spool\PRINTERS folder have different content, the file generated running the app on the local machine has the exact same commands that were sent to the printer while the file generated while running the app on a remote machine have the following content:
CT~~CD,~CC^~CT~
^XA
^PW812
^POI^PQ1,0,1,Y^XZ
Anyone having similar issues with Zebra printers when printing remotelly? Any ideas on how to solve this issue?
Thanks in advance.