Re: Proper Way to Deal with Printers in MFC?
From: Johan Rosengren (johan.rosengren_at_telia.com)
Date: 09/10/04
- Next message: Johan Rosengren: "Re: Menu on my dialog based application."
- Previous message: Rail Jon Rogut: "Re: Problem of switching Shared MFC DLL project to MFC Static Libraries"
- In reply to: Gerry Murphy: "Proper Way to Deal with Printers in MFC?"
- Next in thread: Julian Nicholls: "Re: Proper Way to Deal with Printers in MFC?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Sep 2004 08:21:44 +0200
Gerry,
Printing and resolutions is indeed a tricky field. If you have adapted your
code to work on both 300 and 600 dpi, by getting the actual resolution, it
should work on all resolutions - this is also the way I usually do it
(interrogating and use the resolution as a multiplying factor). So, it seems
like you are not doing this correctly - perhaps you want to revise the
functionality where you calculate the font size depending on the resolution?
If you are pressed for time, however, and are only printing text, you might
want to create the fonts using CreatePointFont(Indirect), where you use
typographical points as a measurement of the font height. A typographical
point is equally sized on all printers, regardless of resolution.
Johan Rosengren
Abstrakt Mekanik AB
"Gerry Murphy" <gerrymurphy@rcn.com> a écrit dans le message de
news:4140e546$0$6904$61fed72c@news.rcn.com...
> Hello,
>
> I'm having the following problem on what was supposed to
> be a quick development job.
>
> I've written an MFC app that runs a test and then prints out
> a report. (multiple font sizes involved, as well as Unicode box-
> drawing characters.) Everything was working O.K. on my development
> machine, but, as usually happens, it failed on the equipment
> in the field when printing.
>
> <Dope slap to myself> In my rush to do it I assumed the
> printer had 600 DPI, as did the one I used. Of course the
> one in the field has 300 DPI.
>
> So I went back and used GetDeviceCaps(LOGPIXELSX) and
> GetDeviceCaps(LOGPIXELSY) to query the printer and adjust
> for the resolution it finds. Before deploying it the
> customer decided to test it on a hi-quality printer set to
> 5760 by 720. It promptly failed again. (It's only printing
> the top-left quarter blown up to full-page approximately.)
>
> Am I doing something really stupid? Am I approaching this
> the wrong way?
>
> Appreciate any advice you can give.
>
> TIA,
>
> Gerry Murphy
>
>
- Next message: Johan Rosengren: "Re: Menu on my dialog based application."
- Previous message: Rail Jon Rogut: "Re: Problem of switching Shared MFC DLL project to MFC Static Libraries"
- In reply to: Gerry Murphy: "Proper Way to Deal with Printers in MFC?"
- Next in thread: Julian Nicholls: "Re: Proper Way to Deal with Printers in MFC?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|