Printing using Visual .Net C++ - Programmer

This is a discussion on Printing using Visual .Net C++ - Programmer ; Hi! I am writing an application using Visual Studio .Net C++ and I'm trying to make a functionality that I could use for printing several pages of text to printer. Everything goes fine except the function call: int paperHeight = ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Printing using Visual .Net C++

  1. Printing using Visual .Net C++

    Hi!

    I am writing an application using Visual Studio .Net C++ and I'm trying to
    make a functionality that I could use for printing several pages of text to
    printer.

    Everything goes fine except the function call:

    int paperHeight = GetDeviceCaps(hDC, VERTRES)

    returns slighlt different result on two different computers. I select Paper
    Size A4 for in both computers. Could it be possible that there are
    differences in different platforms or are there some settings that can
    affect the result that function returns?

    Or is there some better way to find out the paper height?

    - Tuomo Heikkilä



  2. Re: Printing using Visual .Net C++

    Tuomo wrote:

    > Everything goes fine except the function call:
    >
    > int paperHeight = GetDeviceCaps(hDC, VERTRES)
    >
    > returns slighlt different result on two different computers. I
    > select Paper Size A4 for in both computers.


    Since when has vertical resolution been equivalent to paper
    height?

    You are asking the device "what is your vertical resolution?",
    which depenging on the deveice, the device configuration can
    easily vary from system to system.

    In any case, the pixels resolution value returned will have
    nothing todo with paper height.

    You would need to use GetDeviceCaps, VERTRES in combination with a
    GetDeviceCaps, LOGPIXELSY to find the ture page size.



    Jussi Jumppanen
    Author of: Zeus for Windows (All new version 3.92 out now)
    "The C/C++, Cobol, Java, HTML, Python, PHP, Perl programmer's editor"
    Home Page: http://www.zeusedit.com

  3. Re: Printing using Visual .Net C++


    "Jussi Jumppanen" wrote in message
    news:40704666.7B33@zeusedit.com...
    > Tuomo wrote:
    >
    > > Everything goes fine except the function call:
    > >
    > > int paperHeight = GetDeviceCaps(hDC, VERTRES)
    > >
    > > returns slighlt different result on two different computers. I
    > > select Paper Size A4 for in both computers.

    >
    > Since when has vertical resolution been equivalent to paper
    > height?
    >
    > You are asking the device "what is your vertical resolution?",
    > which depenging on the deveice, the device configuration can
    > easily vary from system to system.
    >
    > In any case, the pixels resolution value returned will have
    > nothing todo with paper height.
    >
    > You would need to use GetDeviceCaps, VERTRES in combination with a
    > GetDeviceCaps, LOGPIXELSY to find the ture page size.
    >


    I asked VERTRES and LOGPIXELSY on both test computers and the results were
    following:
    VERTRES LOGPIXELSY
    6700 600
    6808 600

    The problem seems to be that LOGPIXELSY is same on both computers and
    VERTRES varies. LOGPIXELS seems to be the Print quality(DPI) value selected
    in printer preferences and VERTRES varies according to paper size(A4,
    Letter, etc). It seems that we can't find the paper height in this way.

    Do you have any other ideas? Thanks anyway.

    - Tuomo



+ Reply to Thread