Re: Educate me on Printing

new topic     » goto parent     » topic index » view thread      » older message » newer message

George Walters wrote:
> 
> 
> I thought I new how to print in windows using Win32 but apparently I don't
> know...or I'm missing the point all together.
> 
> I've been using this
> 
> fontSize = getFontSize( Printer ) -- get the font metrics
> 
> and spacing down the page like this
> 
>     line += 1
>     setPosition(Printer,0,line*fontSize[2])
>     wPuts(Printer,"stuff")
> 
> where line is the line number down the page
> 
> The problem is I get different spacing from printer to printer as you go down.
> the page. The laser does one thing and the inkjet is different. So I can't
> fill
> in forms consistently (like labels for addresses etc)
> 
> Can someone explain how to make a printer output the same from one to the
> other?

The problem with the code above is that you are using pixels as the unit of
measure rather than inches or millimeters. The problem with pixels is that each
device uses a different size for a pixel. As things like labels are measured in
inches/mm you need to convert the distance between labels from inches/mm to
pixels for the specific device you are printing to.

I suggest that you research the GetDeviceCaps API call as this will give you the
required data to perform the conversion calculations.

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu