Welcome Guest Search | Active Topics | Sign In | Register

Capture whole Webpage Options
NCA Procurement
Posted: Tuesday, January 25, 2022 10:28:09 AM
Rank: Newbie
Groups: Member

Joined: 2/24/2020
Posts: 1
I'm trying to capture an image of the whole webpage loaded in the EO Webbrowser.

I've tried using the Capture/CaptureRaw methods of the webview.
But this seem to only capture what currently shown on screen.

How can a capture the whole page and not just part of the page visible on screen.

Thank you
eo_support
Posted: Tuesday, January 25, 2022 4:02:23 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

You would need to explicitly specify the source rectangle of the capture with either one of these Capture overloads:

https://www.essentialobjects.com/doc/eo.webbrowser.webview.capture_overload_1
https://www.essentialobjects.com/doc/eo.webbrowser.webview.capture_overload_2

If you do not set the source rectangle, the it defaults to the screen area. You can use code like this to get the full page height:

Code: C#
int nFullPageHeight = (int)webView.EvalScript("document.body.offsetHeight");


However please keep in mind that the capture requires a large bitmap buffer to function. So if you try to capture too big an area, you may run into out of memory error. In that case capture will fail. In that case you can try to use the first overload that specifies a smaller targetSize --- the image will be zoomed out in that case but will have a smaller size and take up less memory.

Hope this helps. Please feel free to let us know if you still have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.