0

I am using Adobe control in a WindowsFormsHost control to render PDFs. This feature isnt crucial for the application and not every user will have Adobe Reader installed.

My question is, what will be the best way to detect that something is wrong (or will go wrong once I try to open something) with the control, and make its Visibility to Collapsed afterwards?

I need to find it out before any PDF is actually opened, since the application needs to download the PDFs and they can be large.

Kara
  • 6,115
  • 16
  • 50
  • 57
Tomas Grosup
  • 6,396
  • 3
  • 30
  • 44
  • 1
    Not news to you but hosting Acrobat controls in com (or .NET) is problematic. Shut it down with every unload and load fresh. – paparazzo Jul 03 '12 at 16:11
  • Will just calling .Dispose() on the axCroPDF control do the job or do I also need to kill the adobe process? – Tomas Grosup Jul 04 '12 at 09:03
  • 1
    Would start with .Dispose(). Since users are going to have different version of Adobe and different configurations there is no single answer. And there is no perfect answer. – paparazzo Jul 04 '12 at 12:58
  • I know, I just figured that even fatal errors inside the adobe control (like invalid pdf file) dont throw any exceptions in my application, so there is no way for me to detect them. Unfortunately, such an error made the whole application completely frozen :(. – Tomas Grosup Jul 04 '12 at 13:19
  • You will find other happy stuff like it eating a key down event. If you can go XPS there are good reliable UI controls from Microsoft. But you are not going to find a free (or even inexpensive) way to reliably create XPS in bulk. – paparazzo Jul 04 '12 at 14:15

1 Answers1

0

I found no way of catching all exceptions that occur in this control. If you dont want it to freeze your application, run it in a completely separate process.

Tomas Grosup
  • 6,396
  • 3
  • 30
  • 44