文件名称:[原创]使用MFC实现文档打印
文件大小:4KB
文件格式:RAR
更新时间:2019-06-30 15:40:23
MFC 打印 文档 VS2008 C++
1.调用方法_打印预览 CPrintFrame* pWndPrint = new CPrintFrame; CCreateContext context; context.m_pNewViewClass = RUNTIME_CLASS(CPrintView); context.m_pCurrentFrame = pWndPrint; context.m_pCurrentDoc = NULL; context.m_pLastView = NULL; pWndPrint->Create(NULL,"打印",WS_OVERLAPPEDWINDOW,CFrameWnd::rectDefault, NULL,NULL,0,&context); pWndPrint->PrintPreview(); 2.调用方法_直接打印 CPrintFrame* pWndPrint = new CPrintFrame; CCreateContext context; context.m_pNewViewClass = RUNTIME_CLASS(CPrintView); context.m_pCurrentFrame = pWndPrint; context.m_pCurrentDoc = NULL; context.m_pLastView = NULL; pWndPrint->Create(NULL,"打印",WS_OVERLAPPEDWINDOW,CFrameWnd::rectDefault, NULL,NULL,0,&context); pWndPrint->Print(); 3.参数设置 可设置打印方向,映射模式、打印页数等,测试样例使用的是DMORIENT_LANDSCAPE(横向打印),MM_LOMETRIC,10页 好用的话,大家给个好评哦
【文件预览】:
PrintFrame.cpp
PrintFrame.h
说明.txt
PrintView.h
PrintView.cpp