Print Preview problem

This is a discussion on Print Preview problem within the Windows Programming forums, part of the Platform Specific Boards category; I made a dialog application that draws text into the window using the device context: Code: CDC* pCD = GetDC(); ...

  1. #1
    Registered User
    Join Date
    Aug 2006
    Location
    Slovenia
    Posts
    12

    Print Preview problem

    I made a dialog application that draws text into the window using the device context:

    Code:
    CDC* pCD = GetDC();
    pDC->TextOut(x, y, "some text I want to print");
    I also made an option in which you can change the font. But when you choose the print preview it is all messed up. Depending on what font size you choose it shows the letters overlapping each other or too far away from each other in the print preview.

    Anyway to fix this?
    Attached Images Attached Images  

  2. #2
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    Check out the Justify function in Petzold's 5th edition, Text and Fonts chapter. I believe this may be what you need.

  3. #3
    Registered User
    Join Date
    Aug 2006
    Location
    Slovenia
    Posts
    12
    Can't find the book anywhere. Can you please tell me where the trick is?

  4. #4
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    Check out this Sample Chapter under the Simple Text Formatting header.

  5. #5
    Registered User
    Join Date
    Aug 2006
    Location
    Slovenia
    Posts
    12
    It seems I need to convert between logical pixel and physical pixel in the OnPrepareDC function. But I just figure it out. Can anyone help me please?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem I Can't solve...
    By ferniture in forum C Programming
    Replies: 3
    Last Post: 07-15-2008, 03:51 AM
  2. Array print problem
    By nixonbw in forum C Programming
    Replies: 2
    Last Post: 03-19-2008, 10:17 AM
  3. Print out first N lines
    By YoYayYo in forum C Programming
    Replies: 1
    Last Post: 02-21-2008, 12:58 AM
  4. Problem With search a file and printing to screen
    By sell682 in forum C++ Programming
    Replies: 4
    Last Post: 05-02-2004, 06:55 AM
  5. print problem
    By maloy in forum C++ Programming
    Replies: 2
    Last Post: 10-05-2002, 11:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21