We have a form that hosts the WebBrowser control. This is the only control over the form.
We pass the form of the path to the temporary PDF file, and it:
WebBrowser1.Navigate(Me._PathToPdf)
When the form closes, it moves away from the PDF file:
WebBrowser1.Hide() WebBrowser1.Navigate("about:blank") Do Until WebBrowser1.ReadyState = WebBrowserReadyState.Complete Application.DoEvents() System.Threading.Thread.Sleep(50) Loop
Once the form is closed, the calling class then deletes the temporary PDF file.
This process works fine ... until we installed Internet Explorer 8. For some reason, a combination of IE8 and Adobe Acrobat 8 (or 9) forces the extra file lock descriptor to fit into a temporary PDF file. The additional lock handle does not disappear until the entire application is closed. I should also mention that there are no locks in the file until Acrobat opens the file.
We can reproduce this on several machines, and it is always a combination of IE8 and Adobe Acrobat Reader. We can install Foxit Reader 3 instead of Adobe Acrobat, and everything works fine. Similarly, we can run the application on a computer with IE7 and Adobe Acrobat, and everything works fine. But when you mix the magic potion of IE 8 and Acrobat, you are in a mess.
Can someone tell me why I get an extra file lock that persists until the end of the application?
Thanks.
An example application demonstrating my problem can be found here: PDFLockProblemDemo.zip
Jason williams
source share