Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want To Print Bill By Using following Code. -
VB
Printer.ScaleMode = vbInches

Printer.PrintQuality = vbPRPQDraft

Printer.ScaleWidth =   6 
Printer.ScaleHeight =  4 

Printer.ScaleLeft = 0
Printer.ScaleTop = 0
Printer.DrawWidth = 8
Printer.FontSize = 8

Printer.CurrentX =0.6
Printer.CurrentY = 1.3
'Memo
Printer.Print "Cash"

Printer.CurrentX =1.5
Printer.CurrentY = 1.3
'Bill No
Printer.Print "123"
printer.enddoc

But Memo & Bill No Not Print Exact Location On Page which is give in code.

Note:- My Bill Size 6 *4, I Set it In Printer server Property Setting WindowsXp ,I Used Dot Matrix Printer lx300.
Posted
Updated 11-Oct-12 14:26pm
v2

1 solution

I'm not sure why Memo and Bill No. is not printing, but i can only quess the reason of this behaviour...
Quote:
By knowing the number of characters that can fit on one line, we can plan the format of the data to be presented. By knowing the number of lines that will fit on one page, we can use logic to perform page breaks and print headings when a page fills up with data. Assuming a standard page size of 8 ½ by 11, we can fit approximately 80 characters per line (with extra characters for a left margin), and 60 lines per page (with extra lines for a top margin).

Try to set FontSize and FontName properties:
http://www.vbtutor.net/vb6/lesson39.html[^]
http://www.vb6.us/tutorials/printing-vb6-using-printer-object[^]
 
Share this answer
 
Comments
yogesh shrikhande 13-Oct-12 14:43pm    
Printer.FontName = "Times New Roman"
Printer.FontSize = 10
I set Font,fontsize But Problem is Still There
Maciej Los 14-Oct-12 11:32am    
Try: Tahoma, size: 8
yogesh shrikhande 2-Nov-12 15:12pm    
One Again I Repeat My Problem

Printer.CurrentX =0.6
Printer.CurrentY = 1.3

Printer.Print "Cash"


"Cash" Not Print at Exact location ie x,y (Left,top) on Paper
Same Concepts I Used for Cheque Book Printing on Laser Printer But Not Info on Exact Location Please Tell me Any Setting for Printer Paper Left or Printer Paper top

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