Home All Groups Group Topic Archive Search About

printing problem with dotmatrix printer using vb.net

Author
16 Feb 2006 8:49 PM
sukhsinghin
Hi,
I am trying to print a invoice form with data from dataset using vb.net

and printer is dot matrix. Invoice is a continues paper with
pre-printed headers like First Name, Last Name, SSN# etc. and after
each header their are some blank block like for SSN# 9 small box. I hv
to print each digit in seprate box. When I tried using following code
it print 1st and 2nd digit on correct place but for the next one goes
between two box
ColPosX = 100
RowPosY = 100
ev.Graphics.DrawString(line, printFont, Brushes.Black, ColPosX,
RowPosY, New stringFormat)

I tried to change the ColPosX and RowPosY for digits but for first 2 or

3 digit it print on correct place then rest in b/w the boxs
Can any one help me to do this..
I hv to print complete form/invoice page in box.
Is there any other way to do this...


Waiting..
Thanks
Sk

Author
16 Feb 2006 10:00 PM
Chris
sukhsing***@gmail.com wrote:
Show quoteHide quote
> Hi,
> I am trying to print a invoice form with data from dataset using vb.net
>
> and printer is dot matrix. Invoice is a continues paper with
> pre-printed headers like First Name, Last Name, SSN# etc. and after
> each header their are some blank block like for SSN# 9 small box. I hv
> to print each digit in seprate box. When I tried using following code
> it print 1st and 2nd digit on correct place but for the next one goes
> between two box
>  ColPosX = 100
> RowPosY = 100
> ev.Graphics.DrawString(line, printFont, Brushes.Black, ColPosX,
> RowPosY, New stringFormat)
>
> I tried to change the ColPosX and RowPosY for digits but for first 2 or
>
> 3 digit it print on correct place then rest in b/w the boxs
> Can any one help me to do this..
> I hv to print complete form/invoice page in box.
> Is there any other way to do this...
>
>
> Waiting..
> Thanks
> Sk
>

What is your print font?  That may cause you problems.  How do you have
the printer installed on the computer?  You may want to try and do raw
printing to the printer, I had success with my reciept printer that way.

Chris
Author
17 Feb 2006 12:44 AM
sukhsinghin
Hi Chris,
Thanks for reply....I am using Arial and and I tried differnt size like
7, 10...
Can you give me some sample of code...its urgent for me...and you are
the only one who said I had done...
please
Waiting...
Sk
Author
17 Feb 2006 12:51 AM
sukhsinghin
forget to add..I am using USB port for connecting to printer..
Author
16 Feb 2006 11:40 PM
Herfried K. Wagner [MVP]
<sukhsing***@gmail.com> schrieb:
> I am trying to print a invoice form with data from dataset using vb.net
>
> and printer is dot matrix.

Depending on the printer you may find the article below useful:

HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>