Click here to Skip to main content
14,695,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm developing software that also requires the use of printer Star DP8340SD.
I'm developing in C # with .Net Framework 4 on Windows 7 32-bit.
I connected the printer via an adapter 25 to 9 pin and a RS232-USB.
The driver of the converter and printer have been installed correctly (for the printer driver I tried both linemode_2k-xp_20090529 that SP298_LineMode-Drv_XP-7_20110414)
I tried both through RawPrinterHelper (https://support.microsoft.com/en-us/kb/322091) that PrintDocument(https://msdn.microsoft.com/en-gb/library/system.drawing.printing.printdocument%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396) but without results.

Do you have any advice on the subject of how to print with the DP8340 in .NET?

Thanks!
Posted
Updated 1-Oct-15 1:27am
v3

If you have it installed as a printer, then you don;t want to use Raw Data - you want to treat it as a printer and let the driver do the translation. That means using a PrintDocument[^] instead of a raw printer helper.

If you really want to use a raw helper, then you will have to start looking for info on what data the actual printer expects first, and prove you can send "printable" data in that format before you even start to code.

So Google for an operations manual (or technical if you can find one) and work out what you have to send - it probably won't be as simple as "hello world!"
   
If the printer is simply connected to RS232 port and unknown of windows (no driver).
The only way to drive the printer is to send directly commends via RS232 IO.

Said otherwise, you have to send every commend in the printer language yourself, windows can't help you in this case.

If windows know the printer, I suspect that you will have a problem .
The problem is that windows print graphics, and griphics are big but RS232 is slow.

My advice: build yourself the sequence of commends needed for your printing and send it to the printer. You will need to read the printer manual to get the commends.
   
The solution was the custom cable ...!
Star DP8340 printer has a custom serial cable DB25-to-DB9, I built it and send ASCII strings and printer commands, and everything works, even with the USB-RS232 converter.

Thanks to everyone for the tips!
   

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