如何为不公开 PrintDocument 对象的 C# 对象实现打印预览功能?
【免责声明:我查看了相关问题,只能找到MFC的相关资料。我不使用 C++]
我有一个 C# .Net 应用程序,它通过互操作使用 OCX 控件(该控件是 CGM 图像的查看器组件)。该控件公开 Print() 和 PrintSetup() 方法,但不公开 PrintPreview() 方法。
也没有公开的 PrintDocument 对象可用于实现此功能。
是否有其他方法可以重定向到“打印预览”对话框?
[更多信息]如果它可以帮助某人回答,有问题的控件是 Larson CGM Viewer ActiveX,也称为 VisEx CGM。请参阅http://www.cgmlarson.com/industry/cgm_viewer_control.php
[Disclaimer: I looked at the related questions and could only find relevant material for MFC. I don't do C++]
I've got a C# .Net app that uses a OCX control via interop (the control being a viewer component for CGM images). The control exposes a Print() and PrintSetup() method but not a PrintPreview() method.
There's also no exposed PrintDocument object that I can use to implement this functionality.
Are there any other ways in which I can redirect to a Print Preview dialog?
[More info]In case it helps someone answer, the control in question is the Larson CGM Viewer ActiveX, also referred to as VisEx CGM. See http://www.cgmlarson.com/industry/cgm_viewer_control.php
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 OCX 控件将 CGM 图像作为临时文件保存到临时位置,然后使用 winforms 内置的 PrintPreviewControl 功能吗?
Can you use the OCX control to save the CGM image to a temp location as a temp file and then use the winforms built-in PrintPreviewControl functionality?
最后,我与供应商进行了交谈 - 他们有一个桌面产品,他们使用自己的控件(又名吃自己的狗粮),甚至他们没有打印预览功能。
即使供应商不提供或不支持,我也不会费尽心思去获得某个功能——就像我讨厌告诉最终用户有些事情不能做一样。
In the end I spoke to the vendor - they have a desktop product that they use their own control in (aka eating their own dogfood) and even they don't have Print Preview functionality.
I'm not gonna jump through hoops to get a feature even the vendor doesn't provide or support - much as I hate telling end users something can't be done.