Discussion:
printable area in MFC applications
(too old to reply)
Vaclav
2011-08-03 16:21:37 UTC
Permalink
I noticed the printable area in MFC applications is calculated
incorrectly.

To verify that, I put together a simple document-view project with
default settings. I overrid the OnPaint method of the view and added a
statement that draws a border of the printable area:


void CpokusDrawableAreaView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
CView::OnPrint(pDC, pInfo);
pDC->Rectangle(pInfo->m_rectDraw);
}


When the page is printed or print-previewed, 3 edges are very thin but
one is thick. I do not think that is the real printable area of the
printer. I tried various printers.

Please see screenshot here:
http://www.2shared.com/photo/14I-3ZQ9/print_preview.html

Any ideas?

Thanks
Vaclav
Joseph M. Newcomer
2011-08-04 01:38:56 UTC
Permalink
You only need to post the question once.
joe
Post by Vaclav
I noticed the printable area in MFC applications is calculated
incorrectly.
To verify that, I put together a simple document-view project with
default settings. I overrid the OnPaint method of the view and added a
void CpokusDrawableAreaView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
CView::OnPrint(pDC, pInfo);
pDC->Rectangle(pInfo->m_rectDraw);
}
When the page is printed or print-previewed, 3 edges are very thin but
one is thick. I do not think that is the real printable area of the
printer. I tried various printers.
http://www.2shared.com/photo/14I-3ZQ9/print_preview.html
Any ideas?
Thanks
Vaclav
Joseph M. Newcomer [MVP]
email: ***@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Vaclav
2011-08-15 11:17:26 UTC
Permalink
Post by Joseph M. Newcomer
You only need to post the question once.
                        joe
Post by Vaclav
I noticed the printable area in MFC applications is calculated
incorrectly.
To verify that, I put together a simple document-view project with
default settings. I overrid the OnPaint method of the view and added a
void CpokusDrawableAreaView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
   CView::OnPrint(pDC, pInfo);
   pDC->Rectangle(pInfo->m_rectDraw);
}
When the page is printed or print-previewed, 3 edges are very thin but
one is thick. I do not think that is the real printable area of the
printer. I tried various printers.
http://www.2shared.com/photo/14I-3ZQ9/print_preview.html
Any ideas?
Thanks
Vaclav
Joseph M. Newcomer [MVP]
Web:http://www.flounder.com
MVP Tips:http://www.flounder.com/mvp_tips.htm
I apologize for posting twice. The message did not appear so sent it
again.
I tried to print form other programs (MS Office) and realized that the
printer (HP PSC 1510) really has one non-printable edge very thick (15
mm) and the others are cca 3 mm. So there is no bug in the code.
Problem resolved.

Thanks
Vaclav

Joseph M. Newcomer
2011-08-05 16:14:14 UTC
Permalink
In addition, you did not specify how you "tried" various printers. Which was the default
printer? There are lots of things you might have done, and some of them would have no
effect on the print preview, so saying you "tried various printers" is not informative. It
might have been the case that you used a scenario where print preview always reverted to
the default printer.
joe
Post by Vaclav
I noticed the printable area in MFC applications is calculated
incorrectly.
To verify that, I put together a simple document-view project with
default settings. I overrid the OnPaint method of the view and added a
void CpokusDrawableAreaView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
CView::OnPrint(pDC, pInfo);
pDC->Rectangle(pInfo->m_rectDraw);
}
When the page is printed or print-previewed, 3 edges are very thin but
one is thick. I do not think that is the real printable area of the
printer. I tried various printers.
http://www.2shared.com/photo/14I-3ZQ9/print_preview.html
Any ideas?
Thanks
Vaclav
Joseph M. Newcomer [MVP]
email: ***@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Loading...