rajani Level: Graduate
 Registered: 25-11-2004 Posts: 9
|
printer.print problem
Hello,
I am printing tickets on my pre printed paper. I am generating output and storing in a text file. When the print button is clicked, the data is read from the textfile and directs to the printer. I need to count the no of lines. so, i am copying to text file. This is my code...
Dim ret As Integer
Printer.PrintQuality = -1
Printer.FontName = "draft 10cpi"
Printer.FontBold = False
Printer.FontItalic = False
Printer.FontSize = 8
ret = MsgBox("Print(Y/N)", vbYesNo)
If ret = 6 Then printcontents
Dim objfile As Object, ln As Integer, ctext As Object
Set ctext = fso.CreateTextFile("c:\tempprint.txt", True)
ctext.WriteLine txtResult.Text
ctext.Close
Set ctext = Nothing
txtResult.Text = ""
Set objfile = fso.OpenTextFile("c:\tempprint.txt", ForReading, True)
ln = 1
Do While Not objfile.AtEndOfStream
Printer.Print objfile.ReadLine()
Printer.Print
Printer.Print
Printer.Print
ln = ln + 3
Loop
Printer.EndDoc
My problem is, vertical spacing. According to the code, i am printing 3 lines in each iteration. After printing some lines the lines are moving up/down not in the proper way. Why is this happening? I am strucked at this place. Pls help me. Its urgent.
C the link how its printing. That is my pre printed ticket and the output printed from the code.
http://m.1asphost.com/tsimsha/images/ticket.jpg
Everytime i need to print minimum >500 lines(tickets). So i need to print faster. Thats why i am using printer.print with Draft 10cpi font. I need to print continuously until the tickets are over without any interruption or interaction.
Actually this is available in foxpro 2.5. There its printing correctly. I modified the application to VB. I have this problem.
Sorry for the long problem. But i want to explain clearly.
Finally, how can i set the equal vertical spacing. And the paper width also not sufficient in VB where as in foxpro the same width but no problem.
Thax in advance
|