Avatar of wimmeyvaert
wimmeyvaert

asked on 

Sending content of a textfile to a LabelPrinter using TNMFTPComponent ...

Hi all,

I have a thermal Labelprinter (Intermec EasyCode 3400).
I have a textfile on my disk with following content :
<STX><ESC>C<ETX><STX><ESC>E6<CAN><ETX>
<STX><ESC>F01<NUL>1310125<ETX>
<STX><ESC>F06<NUL>Here comes some text<ETX>
<STX><ESC>F48<NUL>27/02/2007 08:38:46<ETX>
<STX><ESC>F11<NUL>Her comes a number<ETX>
<STX><RS>1<ETB><ETX>
<STX><ESC>C<ETX>

When I go to the command prompt of Windows (XP) and I type 'ftp <ipaddress_of_printer>, and I also give username and password, I am connected to the printer.
When I then use command 'put D:\Label.txt', the label is correctly printed.
So I can print data on the printer using FTP.

So, logically I want to do the same from within Delphi using the TNMFTP-Component.
Only problem is that I can't get it to work.
I tried the SendFile-Method but no success.
I tried the DoCommand, but no success.

Is there anyone who did something like this before, and can help me out on this one ?

Btw, I'm using Delphi 5 Enterprise Edition on Windows XP platform.

Thanks in advance for you help.

Wim.
Delphi

Avatar of undefined
Last Comment
wimmeyvaert
ASKER CERTIFIED SOLUTION
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
After you get them installed, drop an idFTP control and a TButton on your form
and set the host to the IP address of the printer, the username and password
and then add this button's click event:

procedure TForm1.Button1Click(Sender: TObject);
begin
  idFTP1.Connect;
  if idFTP1.Connected then
  begin
    idFTP1.Put('D:\Label.txt');    
  end;
  idFTP1.Disconnect;
end;
Avatar of wimmeyvaert
wimmeyvaert

ASKER

Hi EddieShipman,

I'm not at work anymore (where I need this solution), and I can't reproduce the problem from home, but I will try to download/install the Indy-components and then leave a message here.

Thanks so far.

Best regards,
Good, just post the results here. I don't have an Itermec printer here, either so you will have
to be the QA...
Avatar of wimmeyvaert
wimmeyvaert

ASKER

Hi Ediie Shipman.

Your provided solution works like a charm !
Only disadvantage is that my executable grows with > 200 K after implementing the TidFTP-Component !!!
But in my case, that is not a big problem.
Thanks again for your help.

Best regards,

Wim.

Delphi
Delphi

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.

60K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo