|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
As you said, your problem is related to the vertical spacing and can be corrected by sending a code understood by the printer to change thee vertical spacing, but it depends on the printer you use and you said nothing about wich kind of printer is used.
But the printing looks like epson compatible printer, so... http://www.missico.com/personal/support/epson_escape_codes.htm may help, remember that <esc> is character #27 ESC J can be used (Just one insteed of 3 line feed), but remember that the "n" is a character with the number of 1/180 inch of a jump. printer.print chr(27) & "J" & CHR(180) ' JUMPs one inch. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Printer.print problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|