jroriz Active Member Licensed User Longtime User Aug 5, 2020 #1 A friend asked me to create a desktop application for him based on his website. The webview would be perfect, but it does not open links in new windows, and that would be mandatory, especially in print routines. Is there a workaround for this? Use this page to test: WebView1.Loadurl ("https://sisweb.app/test") This page has only one button with onclick = "window.print ()"
A friend asked me to create a desktop application for him based on his website. The webview would be perfect, but it does not open links in new windows, and that would be mandatory, especially in print routines. Is there a workaround for this? Use this page to test: WebView1.Loadurl ("https://sisweb.app/test") This page has only one button with onclick = "window.print ()"
Erel B4X founder Staff member Licensed User Longtime User Aug 5, 2020 #2 The best you can do is to handle the LocationChanged event and get the URL. You can then revert back to the previous URL. Upvote 0
The best you can do is to handle the LocationChanged event and get the URL. You can then revert back to the previous URL.
jroriz Active Member Licensed User Longtime User Aug 5, 2020 #3 Erel said: The best you can do is to handle the LocationChanged event and get the URL. You can then revert back to the previous URL. Click to expand... Well, I was able to detect the page following your guidance. My first idea was to send the page to the browser to print (fx.ShowExternalDocument), but there needs to be an open session, so the browser asks for a username and password. The webview correctly renders what needs to be printed. So I tried to print the content using JavaFX8 (I printed the webview), but the result was terrible. Would it be possible to capture the rendered html in the webview and then use the printhtml to print? Upvote 0
Erel said: The best you can do is to handle the LocationChanged event and get the URL. You can then revert back to the previous URL. Click to expand... Well, I was able to detect the page following your guidance. My first idea was to send the page to the browser to print (fx.ShowExternalDocument), but there needs to be an open session, so the browser asks for a username and password. The webview correctly renders what needs to be printed. So I tried to print the content using JavaFX8 (I printed the webview), but the result was terrible. Would it be possible to capture the rendered html in the webview and then use the printhtml to print?
jroriz Active Member Licensed User Longtime User Aug 6, 2020 #4 Solved. Removed session validation from page. Downloaded the page and printed with printhtml. Upvote 0