SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old December 11th, 2004, 07:20 PM
rajanikrishna rajanikrishna is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 33 rajanikrishna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Question 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

Reply With Quote
  #2  
Old December 13th, 2004, 11:40 AM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 4
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Printer.print problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway