令人沮丧的打印/打印预览问题 [英] Frustrating print / printpreview problem

查看:85
本文介绍了令人沮丧的打印/打印预览问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我一直在追逐这个问题好几天,并且碰壁了,所以我一直在这里乞求一些见识.

情况如下:
我有一个多文档应用程序,有6种不同的文档类型,每种都可以通过选项卡式界面查看.在这6种不同的文档类型中,没有一种我将要描述的问题.该文档与其他文档之间的区别在于,它是单页文档,而另一文档是多页文档.

问题:
当我打印文档时(即使仅打印了通过打印对话框选择的一页),然后再进行第二个打印请求(例如,一页),该页面将以大字体打印.眼球使输出看起来至少是24点字体.在后续的打印请求中,问题仍然存在,直到我进行打印预览为止.一旦我执行了打印预览,就可以正常工作(有时printpreview会有相同的大字体问题,但是第二个打印预览请求将纠正该问题),然后再执行另一个打印请求,则打印输出将是完美的:无论被中间的打印预览请求更正了.

这让我发疯:我看不到行为正确的文档和有问题的文档之间的实质性区别.我逐行比较了不同的打印逻辑集,同样,具有正确行为的集与出现问题的集之间没有实质性差异.

我不是在寻找解决方案,而只是从以下地方开始:我已经尽我所能想象的所有可能性,在这里以及在CodeGURU等处搜寻张贴的问题/解决方案.

作为参考,我正在使用Visual Studio 2005,C ++/MFC.所有视图窗口均使用CScrollView/QZoomView(启用视图缩放功能).我最初以为QZoomView是问题的原因,但是QZoomView中没有处理任何打印活动.

感谢所有建议

To start, I''ve been chasing this problem for days and have hit a wall so I''ve landed here begging for some insight.

Here''s the situation:
I have a multi-document app, 6 different document types and each are viewable through a tabbed interface. Of these 6 different document types, one does not have the problem that I am about to describe. There difference between that one document and the others is that it is a single page document while the other are multi-page.

The problem:
When I print a document (even when I print just 1 page as selected via the print dialog) then follow that with a second print request (1 page for example) the page prints with huge fonts. Eye balling the output it would appear to be a 24 point font at least. The problem persists on subsequent print requests, until I do a print-preview. Once I do a print preview, which will work just fine (sometimes the printpreview will have the same large font problem but a 2nd print preview request will correct the problem), then follow that by another print request the printed output will be perfect: whatever is screwed up is corrected by the interveening print preview request.

This is driving me crazy: I cannot see any substantial difference between between the document that behaves correctly and the documents with the problem. I have gone line by line comparing the different sets of print logic and again, there is no substantial difference between the one with the correct behavior and the ones wth the problem.

I''m not looking for a solution, just a place to start as: I have exhausted every possibility I could imagine, scoured posted questions / solutions here and at CodeGURU, etc.

For reference, I''m using Visual Studio 2005, C++ / MFC. The view window for all employs CScrollView / QZoomView (enables a zoom capability for views). I had initially thought QZoomView was the cause of the problem but none of the print activities are handled in QZoomView.

Any and all suggestions appreciated

推荐答案

屏幕上的点不会将1:1映射到纸上的点.您需要如此处所述,为不同的ouptut设备上下文更改图像映射模式. a> [ ^ ].
Dots on screen do not map 1:1 to dots on paper. You need to change the image mapping mode for the different ouptut device context as described here[^].


您的OnPrint代码是否以与接收时相同的状态返回提供的HDC?
Is your OnPrint code returning the HDC''s supplied in the same state as when you received it?


这篇关于令人沮丧的打印/打印预览问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆