ArtK
ArtK

Reputation: 1185

PDF Viewer hosting forms hugging control after closing

A bunch of my C# and VB programs utilize PDFViewer control and AxAcroPDFlib. It's been serving me well for years but recently, after installing Adobe Reader DC, all applications using PDFViewer started to have problems.

PDFViewer controls open PDF documents really fast, instantly. However, when I go to close the form hosting PDFViewer control with open PDF document, the form takes anywhere between 5-10 seconds to return control to other form in the same program. Other forms just remain disabled, with hourglass mouse pointer for an extended time. Is there new AxAcroPDFlib that should be used with Reader DC?

Upvotes: 1

Views: 428

Answers (1)

ArtK
ArtK

Reputation: 1185

I was able to track down the issue to the actual PDFViewer control. When Adobe Reader DC is installed, and if PDFViewer control has Focus, the form will have trouble closing. I added FormClosing event handler and added some code to assign Focus to a control other than PDFViewer and then I also disposed of PDFViewer instance. Worked like a charm.

Upvotes: 2

Related Questions