you dont - there is no intrinsic height or width for a web page - so you tell chrome how big you want the image and it does its thing. you can control the size of the layout that it takes a picture of but again there is no way to know ahead of time (just like if you open a browser window it opens at whatever size the browser opens it NOT at whatever size the web page says it should be)
it does - or firefox - either works
I have not checked opera as well but between chrome, ff, opera and IE you probably handle most browsers
the app I’m working on also has tried to use webkit and IE with and without MBS and had mixed results
I can get the height fine with Delphi and TWebBrowser, using IHTMLElement2 and the scrollheight property of it, and the image is always the whole page. I set the browser to that height, the moment it has to create the image, then I create the image and its a 100% match. And thats what I try to replicate with Xojo, NOT using external browser which might not be installed on the clients PC.
If thats not possible, its also ok.
@Christian Schmitz The more serious problem is, that the htmlviewer does not render pages properly. On some pages, images are just not there, or the whole layout is not right, so I wont be able to use htmlviewer with native browser selected. The pages are looking correct when using Webkit, but then the IExxx of your plugin wont work. So I am running in circles somehow.
[code]// make sure we don’t end up with Internet Explorer in version 7, which is default.
Dim v As Integer = IEWebBrowserMBS.GetInternetExplorerVersion
If v < 11000 Then // below version 11.0
Dim b As Boolean = IEWebBrowserMBS.SetInternetExplorerVersion(11000)
If b Then
MsgBox “Requested Internet Explorer version 11.0.”
Else
MsgBox “Failed to set IE version?”
End If
End If[/code]
We added IEWebBrowserMBS.SetInternetExplorerVersion to help with our new Evaluate function to work properly.
[quote=471920:@Michael Diehr]There’s a dramatic difference between the default IE 7 rendering engine and IE 11 - so if nothing changed, then you aren’t doing it correctly.
Can you show us your sample code for setting the registry items?[/quote]
There is nothing to show, I have set them “by hand”, not by code.
The .exe is test.exe, I set a key/value in HKCU/SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION with a name of test.exe and a DWORD value of 11000 (I also tried 11001). I rebooted to be sure, and nothing changed in htmlviewer, page still wont get rendered properly.
Yes, but there is currently no other way than to use IE, if you want to make a full page screenshot, not just the visible area. I could never get that to work with Chromium (or Webkit in Xojo).
[quote=471942:@Guenter Kraemer]There is nothing to show, I have set them “by hand”, not by code.
[/quote]
As a test, point your HTMLViewer at this page https://www.whatismybrowser.com/detect/what-is-my-user-agent and see what the userAgent string says.
With the IE7 renderer under Windows 10 it shows something like this:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E)
With the IE11 renderer under Windows 10 it shows something like this:
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
[quote]
[/quote]
And also use HTML5 DOCTYPE at the start of the document:
Then not only will the IE-11 renderer be loaded, but it will render as IE-11 and not IE-7.
It took me a lot of time experimenting and web-searches to discover that this is necessary, which is why I asked for it to be added to the HTMLviewer docs.
The registry changes make the IE-11 renderer load. The addition here makes it work properly.
[quote=471972:@Tim Streater]You need also to add this in your HTML page:
And also use HTML5 DOCTYPE at the start of the document:
Then not only will the IE-11 renderer be loaded, but it will render as IE-11 and not IE-7.
It took me a lot of time experimenting and web-searches to discover that this is necessary, which is why I asked for it to be added to the HTMLviewer docs.
The registry changes make the IE-11 renderer load. The addition here makes it work properly.[/quote]
The page ist not my page, so how shall I change the code in it? Anyway, I will give up with this for now.