Re: Proper Way to Deal with Printers in MFC?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Johan Rosengren (johan.rosengren_at_telia.com)
Date: 09/10/04


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
>
>



Relevant Pages

  • Re: X fonts in konqueror and OpenOffice too large
    ... > and refuses to change font size, ... physical resolution ... The workaround is to force the X server to report its ... The above figures make X report a dpi of 100 when used with 1280x1024 ...
    (comp.os.linux.setup)
  • Re: resolution
    ... How can one decrease the resolution so the font size are bigger ... Changing the DPI has helped them quite a bit. ... The one caveat is when a piece of software has been set for a specific resolution. ... I have a document manager that I wrote which assumes a minimum resolution of XGA if the resolution is set to XGA but the DPI is set to 110, then the application does not display properly on the screen. ...
    (microsoft.public.windowsxp.general)
  • [kde-linux] Re: KDE on high resolution monitor
    ... 1920x1080 resolution, using KDE 4.4 stable suse, well with high ... You can of course change the individual font sizes, OR, you can change the ... DPI, using the force fonts DPI setting. ...
    (KDE)
  • Re: Vewports and Mapping Modes
    ... resolution or more accurately DPI of a window. ... I could simulate this by multiplying the font size by some ... well rendering out to one printer at 600 DPI, ...
    (microsoft.public.win32.programmer.gdi)
  • Inkjet printer best results. RIP software ?
    ... printing technologies so I apologize if my questions seem rather basic. ... no control over the resolution used for printing. ... placing each pixel on the printed photo instead of just defaulting to the ... How can I control the final resolution and force the printer to use all ...
    (comp.periphs.printers)