Rob Cowell
Rob Cowell

Reputation: 1618

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

[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

Upvotes: 0

Views: 937

Answers (2)

Rob Cowell
Rob Cowell

Reputation: 1618

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.

Upvotes: 0

Jeff Widmer
Jeff Widmer

Reputation: 4876

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?

Upvotes: 1

Related Questions