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.

5
  • 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 3, 2012 at 16:11
  • Will just calling .Dispose() on the axCroPDF control do the job or do I also need to kill the adobe process? Jul 4, 2012 at 9: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 4, 2012 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 :(. Jul 4, 2012 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 4, 2012 at 14:15

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.