Re: Cheque Writing with VB
- From: "Mike Williams" <Mike@xxxxxxxxxxxxxxxxx>
- Date: Mon, 31 Oct 2005 20:21:41 -0000
"Joe O" <jp3BlessNoSpam@xxxxxxxxxxx> wrote in message
news:u7i1QTk3FHA.3592@xxxxxxxxxxxxxxxxxxxxxxx
> Sorry I forgot clarify that point. These are preprinted cheques with
> institution codes/Numbers and everything thing in place. Much like
> cheque book but in A4 format... the top part is the actual cheque
> while the bottom part stores information related to the cheque.
All you need to do is measure (with a standard rule) the positions on the
actual A4 page where you want the various text items and numbers to appear.
Then you can use Printer.CurrentX and Printer.CurrentY to set the position
before printing each item. Remember that the position of a printed string is
actually the position of the top left corner of the first character of that
string. If you want to instead position the string with respect to the
bottom left corner of the first character then you can use
Printer.TextHeight to get the height of each character and adjust your code
accordingly. That would place the text so that the bottom of the character
cells sits at the appropriate y coordinate (the TextHeight of each character
in a specific font name and size is the same). Remember that the bottom of a
character cell is the bottom of the character cell itself (which is
approximately the same position as the bottom of the descender on characters
such as "y". If you instead want the descenders to fall below the line your
are printing to then you can get further information using the
GetTextMetrics API or (perhaps more simply) just use an offset of 0.25 times
the TextHeight (or is that 0.2 - I can;t remember offhand, but I'm sure
Jerry will remember and he'll probably post an answer himnself soon). Oh,
one more thing, you'll also need to add some code to set the printer origin
to the top left corner of the physical page (rahter than the default top
left corner of the printable area). It's all quite simple, but it does need
a bit of though to get right. I haven't got time at the moment, but if
nobody has produced sample code for you by tomorrow then post again and I'll
knock some up for you.
Mike
.
- Prev by Date: Re: One thing I noticed
- Next by Date: Re: Form Question
- Previous by thread: Re: Cheque Writing with VB
- Next by thread: Re: Cheque Writing with VB
- Index(es):
Relevant Pages
|