Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Before everyone tells me I am mad I know. Who would in their right mind use a dot-matrix printer in 2020. Well, I am! We are trying to use it to print shipping information for transport companies who do not have a digital system to manage their bookings and are still using handwritten multi-layered paperwork.
What I have done is have our own paperwork printed as a continuous multilayered form to be printed onto using a dot matrix printer.

The printer we are trying to use is an Oki Microline 720 Plus. Here is a link to the user manual https://www.oki.com/printing/download/42113905EE2_ML720P_PH_63088.pdf?id=42113905EE
We have it set up with a Oki LAN7130E Network card installed.

we use a product called printnode to send print jobs from our ERP to our printers. print node supports RAW printing using a Base64 encoded string. we have successfully used this approach to print to Zebra Lable printers using ZPL with no issues so I don't think this is the issue. here is a link to their documentation https://www.printnode.com/en/docs/what-is-raw-printing and https://www.printnode.com/en/docs/api/curl#printjob-creating

the Print node client is running on a Windows Server 2012 R2 instance with the OKI Dot-Matrix 9Pin ESC/P Class Driver installed. I can print From a text document on the Server fine.

when I try to print using ESCP Commands as ASCII or Hexadecimal nothing happens on the printer below is the code that I was trying to use. this I was encoding as Base64 and sending using the PrintNode API. all I got in the print queue on the server is sent to printer.

ASCII

ESC @
ESC 0
ESC 1 10
ESC Q 75
This is a Test Print Wow! CR LF
FF
ESC @


Hexadecimal
1B 40 1B 30 1B 6C 31 30 1B 51 37 35 54 68 69 73 20 69 73 20 61 20 54 65 73 74 20 50 72 69 6e 74 20 57 6f 77 21 0D 0A 0C 1B 40


How can I test the above RAW code from the server directly or am I making a simple mistake
the document that I have been referring to for the above code is both the Oki user manual and the following document from EPSOM. https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjDmPLf4e_qAhXRpOkKHSSVDbsQFjACegQIAhAB&url=https%3A%2F%2Ffiles.support.epson.com%2Fpdf%2Fgeneral%2Fescp2ref.pdf&usg=AOvVaw2-85x1sH-SYp8YNzuqM7cg

What I have tried:

I have tried setting the printer up on a windows 7 VM and using VS2008 to print the Data directly to the printer as a string. all I get is the string typed out.

Realy Stuck Now!

Thanks in advance for any help provided. if I can get this working I will save up to 3 man-hours a day due to not having to handwrite all these documents.
Posted
Updated 28-Jul-20 12:16pm
v3
Comments
Richard MacCutchan 28-Jul-20 7:20am    
The above ASCII and the hex do not match. how are you converting it?
[no name] 28-Jul-20 10:36am    
What Richard does mention in the comment aobove, compare your hex sequence with the text you assume to send. Only a small fragment:

1B ESC
40 '@'
1B ESC
30 '0'
1B ESC
6C 'l'
31 '1'
30 '0'
1B ESC
51 'Q'
37 '7'
35 '5'
54 'T'
68 'h'
69 'i'
73 's'
20 Space
JANeets 28-Jul-20 17:31pm    
My Mistake. they were both put together separately. I did not use a tool to convert it. I have updated the two sections to make them from the same exercise.
I was using the Epson FX Printer commands in the ML720/721 Plus Printer Handbook Linked in my question.

1 solution

Quote:
How do I print to dotmatrix printer using escp

Sending directly commands in printer language without windows messing your command is named raw printing.
Details depend on the programming language, so you will have to do a little search.

A little utility to print a file to printer: Copy to printer[^]
You prepare the printer commands in a file and use the utility to send to printer, it allow you to check that the command sequence is OK.

More utilities from same author: Windows 95+ programs[^]
 
Share this answer
 
Comments
JANeets 28-Jul-20 18:54pm    
Thanks for your Input Patrice T. I will have a tinker with your sujestions and post my findings here.
JANeets 30-Jul-20 3:04am    
Thanks, Guys you have put me on the right path. I will detail below the full solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900