mercredi 21 janvier 2015

Webbrowser control will not show PDF after opening PowerPoint

I have a program written in Vb.net using VS2005, running on a win7 machine. The main form has a split container that has a tree view on the left side and a webbrowser control or image control on the right. The tree view is built from a database that holds relative file paths for multiple file types and the after select method chooses which control to show the file to the user. The program works great but a recent change has created an issue that I can't solve.


Originally, the program would allow a user to select photos and a client Id from a database and then automate PPT to insert the photos resize them organize them in a format and then save the PPT as a jpg with each slide being a separate jpg. Being that pdf files would keep all the pages in the same doc and PPT (10) now supports saving as a pdf a change was made.


The issue is when the webbrowser control is asked to navigate to the pdf file it shows in the control as expected. Switching between images and pdf files works correctly as expected. Once the main form opens PPT even if the user cancels the operation which calls the app.dispose method, once back at the main form the webbrowser control will not display a pdf. The control is loaded, it is visible, it is not nothing, it will take all commands but the pdf will not display. If I close the program and restart it works perfectly. I have tried reusing the browser control, instantiating a new control with every navigate even accessing the adobeRD32 process and calling process.kill before navigating to the pdf. The program does not throw an exception just does not display pdfs after a dialog window and PPT has been opened.


Any help or suggestions would be greatly appreciated. I don't have access to the code today so if needed I will post code tomorrow, just let me know what you want to see.





Aucun commentaire:

Enregistrer un commentaire