本文介绍了如何在不同的打印机上调整打印尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在CDialog框上设置一个程序,该程序将打印一些信息.我有一个小问题.一台打印机可以打印正确的尺寸,而第二台打印机可以打印较小的尺寸.而且我无法更改打印的打印尺寸.有人可以帮我吗?

这是我的代码:

Hi,

I am making a program set on CDialog box which will print some information. And I have a small problem. One printer prints the correct sizes but the second printer prints in smaller sizes. And I am unable to changed the print sizes of the prints. Can somebody help me?

Here is the my code:

void CDELEGACJEDlg::DRUK()
{
     CPrintDialog dlgDRUK(FALSE,PD_ALLPAGES,this);
	CDC p_DC;
	CRect rcB;
	rcB.SetRect(0,0,2400,3000);
	p_DC.SetMapMode(MM_LOMETRIC);
	if(dlgDRUK.DoModal()==IDOK)
	{
		p_DC.Attach(dlgDRUK.GetPrinterDC());

		DOCINFO mojDRUK;
		mojDRUK.cbSize = sizeof(mojDRUK);
		mojDRUK.lpszDocName = "DELEGACJE";
		mojDRUK.lpszOutput = NULL;
		mojDRUK.lpszDatatype = NULL;
		mojDRUK.fwType = NULL;
		if(p_DC.StartDoc(&mojDRUK)>0)
		{
                        CFont fn45;
			p_DC.StartPage();
		        fn45.CreateFont(45,0,0,0,0,false,
                        false,false,ANSI_CHARSET,OUT_TT_PRECIS,
                        CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
                        DEFAULT_PITCH,"Arial");

			COLORREF kolCZARNY(RGB(0,0,0));
			COLORREF kolBIALY(RGB(255,255,255));

			CPen penCZARNY2(PS_SOLID,2,kolCZARNY);
			CPen penBIALY(PS_SOLID,1,kolBIALY);
			CBrush* brOLD = NULL;
			CBrush brSZARY_J(kolSZARY_J);
			CBrush brSZARY_C(kolSZARY_C);
                        brOLD=(CBrush*)p_DC.SelectObject(&brSZARY_J);
                        penOLD=(CPen*)p_DC.SelectObject(&penCZARNY);

                        p_DC.SelectObject(&fn45);
			p_DC.SetBkColor(kolSZARY_C);
			p_DC.TextOut(575,280,"Mountain");
			p_DC.SetTextAlign(TA_RIGHT);
			p_DC.TextOut(640,335,"Summit");


			p_DC.EndPage();
			p_DC.EndDoc();
			p_DC.LPtoDP(rcB);
                        p_DC.SelectObject(brOLD);
                        p_DC.SelectObject(penOLD);
		}
		p_DC.DeleteDC();
	}
	CDialog::OnOK();
}



我是否使用p_DC.SetMapMode(MM_LOMETRIC)函数都没有影响.



It isn''t making a difference whether I am using the p_DC.SetMapMode(MM_LOMETRIC) function or not.

推荐答案



这篇关于如何在不同的打印机上调整打印尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 07:10