Hello everyone.
I have a small build in wxPython and everything is going well. I have a window that must load some pdf files. I use the wx.html2.WebView control. When compiled from the Visual Studio Code IDE, the application works correctly, I can view the pdf correctly. Here the code:
self.vistaPDF=wx.html2.WebView.New(self.panel, pos=(525, 15), size=(555, 545))
self.vistaPDF.LoadURL(file.pdf)
But, when I generate the executable exe with pyinstaller, the pdf file is no longer displayed when executed. What it does is load the “windows file download” window and thus be able to open it from the browser. The PC where it will work is Windows 10 and already has Windows Edge WebView Runtime installed. Reviewing, when the exe file is executed it does not look for the Edge browser, but for Internet Explorer 11 and that is why it is no longer displayed within my own GUI. On the web, I saw that they recommend the following: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
But I see that it still indicates IE. Then I found that I have to modify the backend of Edge (Chromium) so that it ignores IE, but here if I need help, why I don’t know how to implement that part, in code it should be like this:
self.browser = wx.html2.WebView.New(self, backend=wx.html2.WebViewBackendEdge)
But it has no effect. Another alternative would be to use the PyMuPDF library, but that converts the PDF to an image and that will probably be slower with large files. Did anyone have the same problem with Edge (Chromium) backend?
Thanks.