Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 222965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:10:36+00:00 2026-05-11T19:10:36+00:00

When I print the CDC for a report control that I’ve created it appears

  • 0

When I print the CDC for a report control that I’ve created it appears tiny (less than 1 square inch on paper). How can I get the report to be printed to occupy the entire page ?
Or in other words, how can I make the entire report to appear in one printed page.


CPrintDialog printDialog(FALSE);
printDialog.DoModal();

CDC dcPrint;
if(dcPrint.Attach(printDialog.GetPrinterDC()))
{
    int iHorzRes = dcPrint.GetDeviceCaps(HORZRES);
    int iVertRes = dcPrint.GetDeviceCaps(VERTRES);

    int iHorzResCDC = m_CDC.GetDeviceCaps(HORZRES);
    int iVertResCDC = m_CDC.GetDeviceCaps(VERTRES);

    dcPrint.m_bPrinting = TRUE;
            dcPrint.BitBlt(0,0, iHorzRes, iVertRes, &m_CDC, iHorzResCDC, iVertResCDC, SRCCOPY);
    CFont* pOldFont = dcPrint.SelectObject(&m_HeaderFont);
    dcPrint.TextOut(0,0,"HelloWorld")       ;
    dcPrint.SelectObject(pOldFont);

    CPrintInfo printInfo;
    printInfo.m_rectDraw.SetRect(0,0, iHorzRes, iVertRes);
    dcPrint.StartDoc("Report Print");       
    dcPrint.StartPage();
    if(dcPrint.EndPage())
        dcPrint.EndDoc();
    else
        dcPrint.AbortDoc();     
}

dcPrint.DeleteDC();

m_CDC is the memory DC that I use to buffer and display the entire report on screen.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:10:36+00:00Added an answer on May 11, 2026 at 7:10 pm

    As others have said, this is because, in general, the display resolution of printers is a lot higher than displays. Displays are usually 96 to 120DPI: at 96DPI this means that an image of 96 pixels (dots) by 96 pixels occupies approximately 1 square inch on the display. However, if you just take that image and print it out on a 600DPI printer, the size of the image will be about 1/6″ by 1/6″ – much smaller. This is a bane of the publishing world – images that look fine on displays often look either tiny or terrible when printed.

    You could, as has been suggested, use StretchBlt rather than BitBlt to scale up your image. Depending on the difference between your display and printer, this will either look a bit blocky, or utterly hideously blocky.

    A much better option is to rewrite your code that does the drawing of the control so that you’ve got a method that takes a device context (and some co-ordinates) and draws into it. Your normal window painting code can pass the memory DC to this routine and then BitBlt the result to the window, and your painting code can call this method with the printer DC and some suitable co-ordinates.

    When writing this routine you’ll have to worry about scaling: for example, you’ll need to create fonts for the given device context, and with a scaling-indepdendant size (that is, specify the font size in points, not pixels), rather than relying on a pre-created font.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 135k
  • Answers 135k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You probably want the PK to be an AutoField instead… May 12, 2026 at 7:04 am
  • Editorial Team
    Editorial Team added an answer I faced the same CPU utilization problem with the settings… May 12, 2026 at 7:04 am
  • Editorial Team
    Editorial Team added an answer You're looking for the registry setting for URLAction 0x1609, which… May 12, 2026 at 7:04 am

Related Questions

When I print the CDC for a report control that I've created it appears
I have a mature MFC C++ application that displays on screen and prints using
I am writing a batch script intended for handling some tasks in my (and
I have a dialog that resizes. It also has a custom background which I
I am having trouble running a Java program with Windows Powershell 2.0. Any help

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.