小弟通过单文档中自带的打印功能,写了一个打印表格的DrawForm函数,出现两个问题:
1、在我测试的打印机上(四通)打印正常,但是在激光打印机(HP)上打印的时候,字体变的超大。
2、当我打印的表格超出一页的时候,默认的“上一页”“下一页”按钮,根本就不能用。
请问出现以上两个问题是什么原因?要如何解决?请高手指点……
学习,关注……
注:字体是我自己定义的
6 个解决方案
#1
重载OnPrepareDC实现所见即所得打印
void CPrintView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CView::OnPrepareDC(pDC, pInfo);
pDC->SetMapMode(MM_ANISOTROPIC);
CSize size = CSize(800, 560);
pDC->SetWindowExt(size);
int xLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSX);
int yLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSY);
long xExt = (long)size.cx * xLogPixPerInch/96 ;
long yExt = (long)size.cy * yLogPixPerInch/96 ;
pDC->SetViewportExt((int)xExt, (int)yExt);
}
void CPrintView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CView::OnPrepareDC(pDC, pInfo);
pDC->SetMapMode(MM_ANISOTROPIC);
CSize size = CSize(800, 560);
pDC->SetWindowExt(size);
int xLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSX);
int yLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSY);
long xExt = (long)size.cx * xLogPixPerInch/96 ;
long yExt = (long)size.cy * yLogPixPerInch/96 ;
pDC->SetViewportExt((int)xExt, (int)yExt);
}
#2
#3
楼上强啊!怎么成天发?还没有招到人啊?
#4
试试看
#5
分页的要怎么弄啊?
#6
up
#1
重载OnPrepareDC实现所见即所得打印
void CPrintView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CView::OnPrepareDC(pDC, pInfo);
pDC->SetMapMode(MM_ANISOTROPIC);
CSize size = CSize(800, 560);
pDC->SetWindowExt(size);
int xLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSX);
int yLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSY);
long xExt = (long)size.cx * xLogPixPerInch/96 ;
long yExt = (long)size.cy * yLogPixPerInch/96 ;
pDC->SetViewportExt((int)xExt, (int)yExt);
}
void CPrintView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CView::OnPrepareDC(pDC, pInfo);
pDC->SetMapMode(MM_ANISOTROPIC);
CSize size = CSize(800, 560);
pDC->SetWindowExt(size);
int xLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSX);
int yLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSY);
long xExt = (long)size.cx * xLogPixPerInch/96 ;
long yExt = (long)size.cy * yLogPixPerInch/96 ;
pDC->SetViewportExt((int)xExt, (int)yExt);
}
#2
#3
楼上强啊!怎么成天发?还没有招到人啊?
#4
试试看
#5
分页的要怎么弄啊?
#6
up