Print directly to TCP/IP printer port

Does anyone know how to raw print directly to a network tcp/ip printer port (i mean like IP_192.168.0.100)? I know the winspool.writeprinter method and it seems that does not work for printers connected via tcp/ip port. Also tried with the windows.escape method and the PASSTHROUGH param but it sends jobs containing just formfeeds without any text.
My problem is that i need to send some escape codes directly to the printer (for text compression) so i must write directly to it. It works fine with a local printer.
LVL 23
Ferruccio AccalaiSenior developer, analyst and customer assistance Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MainiacfreakusCommented:
Hi

Can't you use some networking components or sockets to do the job?

tcpclient1.Sendln(); tcpclient1 == TTcpClient.

Mainiacfreakus
0
Ferruccio AccalaiSenior developer, analyst and customer assistance Author Commented:
As you can guess i need to print to whatever printer without knowing its port til the job start, so a specified tcp component isn't the right solution, but tnx anyway
0
TheRealLokiSenior DeveloperCommented:
hmm, if i telnet 192.168.1.22 (my printer) I can then see a list of access methods by typeing ?
maybe yours does the same
I can actually just FTP into it, and "Put <file>" to print
ports open are
IPP 631,
FTP 20, 21
LDP 515
9100 9100
don't know if any of this is of use to you, but I sure get a lot of info when I telnet into it
0
TheRealLokiSenior DeveloperCommented:
In fact if I do the following
telnet 192.168.1.22 9100
then type
hello
and then close the telnet session
the printer prints "hello", so it looks like just using a TCP component _may_ do what you want :-)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MainiacfreakusCommented:
Just as I suggested above...

As I see it u have a few choices...
use Indy - TCP or Telnet components
or use sockets - built it yourself components
or use shell commands to telnet in and print.

Best Regards
Mainiacfreakus
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.