I have worked for more than a week to learn how to print directly to a Epson LQ-300+. I solved most of problem by finding answer from here, foxite.com, but still have 2 problem that don't have any hint:
I don't use the
***********
PrintJob
xxxxx
EndPrintJob
***********
approach as it has limitation on the length of paper (max. 22 inch) by the printer. Instead, I used the ??? approach like:
print_string = "ABC 12345 BBDDEE 222"
??? print_string
??? chr(10) + chr(13)
??? print_string2
.......
It works fine except 2 points:
Question 1. I don't know how to change fonts during printing. I followed the site
http://webpages.charter.net/dperr/links/esc_p2.htm to use "ESC k n" where
n = 1 San Serif
n = 2 Courier
n = 3 Prestige
n = 4 Script
But it did not change to any font. My code is:
??? chr(27) + chr(107) + chr(1)
??? "It is San Serif"
??? chr(27) + chr(107) + chr(2)
??? "It is Courier"
??? chr(27) + chr(107) + chr(3)
??? "It is Prestige"
??? chr(27) + chr(107) + chr(4)
??? "It is Script"
But the result is that all the fonts are the same. I tried to use the ASCII code of the 1,2,3,4 too like:
??? chr(27) + chr(107) + chr(48)
??? "It is San Serif"
??? chr(27) + chr(107) + chr(49)
??? "It is Courier"
??? chr(27) + chr(107) + chr(50)
??? "It is Prestige"
??? chr(27) + chr(107) + chr(51)
??? "It is Script"
The result is the same.
Question 2. Ignore the problem of fonts, everything is working fine in my Windows 98. But when I copy my program (exe) to a machine which running Windows XP Profressional, after my run my code, the printer doesn't print. It starts to print until I quitted my program by clicked a button which's click event is:
close databases
clear events
Thisform.release()
I tried to change any properties of the LQ-300+ in the WinXP but still don't change the result.
Anyone has any idea? Thanks.
Power Wong
Every problem will have a solution, the only problem is that can you find it out.