How can I implement a Print Preview function for a C# object that doesn't expose a PrintDocument object?

StackOverflow https://stackoverflow.com/questions/1600072

  •  05-07-2019
  •  | 
  •  

Question

[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

Was it helpful?

Solution 2

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.

OTHER TIPS

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top