How can i convert html document to image using CefSharp?

2,944 views
Skip to first unread message

Khanin Choudhury

unread,
Apr 16, 2013, 9:50:27 AM4/16/13
to cefs...@googlegroups.com
How can i convert html document to image using CefSharp?

anthony taranto

unread,
Apr 18, 2013, 11:18:43 PM4/18/13
to cefs...@googlegroups.com
There is no direct support for doing this. You may be able to look at the WPF WebView code in CefSharp, which renders a webpage to an offscreen buffer and then draws to the screen.

--Anthony


On Tue, Apr 16, 2013 at 6:50 AM, Khanin Choudhury <choudhur...@gmail.com> wrote:
How can i convert html document to image using CefSharp?

--
You received this message because you are subscribed to the Google Groups "CefSharp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefsharp+u...@googlegroups.com.
To post to this group, send email to cefs...@googlegroups.com.
Visit this group at http://groups.google.com/group/cefsharp?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Czarek Tomczak

unread,
May 10, 2013, 2:16:38 AM5/10/13
to cefs...@googlegroups.com
In CEF there is a CefBrowser.GetImage() [1] method with which you can take a screenshot
of a webpage:

virtual bool GetImage(PaintElementType type, int width, int height,
                        void* buffer) =0;

Regards,
Czarek

Timofey Voronov

unread,
Jun 25, 2014, 8:26:13 AM6/25/14
to cefs...@googlegroups.com
Hi Czarek,

there is no anymore that method in the latest release. Could you advice another approach how to convert rendered page to image? (make a screenshot)

пятница, 10 мая 2013 г., 17:16:38 UTC+11 пользователь Czarek Tomczak написал:

Czarek Tomczak

unread,
Jun 25, 2014, 8:33:19 AM6/25/14
to cefs...@googlegroups.com
On Wednesday, June 25, 2014 2:26:13 PM UTC+2, Timofey Voronov wrote:
Hi Czarek,

there is no anymore that method in the latest release. Could you advice another approach how to convert rendered page to image? (make a screenshot)


Timofey Voronov

unread,
Jun 25, 2014, 8:38:57 AM6/25/14
to cefs...@googlegroups.com
Big thanks! 

среда, 25 июня 2014 г., 23:33:19 UTC+11 пользователь Czarek Tomczak написал:

Ivan Samygin

unread,
Aug 11, 2014, 8:09:30 AM8/11/14
to cefs...@googlegroups.com

I've implemented feature of taking full web page snapshot in a forked branch https://github.com/ivan-sam/CefSharp. This implementation depends on a another commit that fixes script evaluation bug https://github.com/cefsharp/CefSharp/issues/445 , so please clone or download the whole branch.

I've modified CefSharp.Wpf.Example project and added Snapshot button that makes snapshot of the page and opens an image.

If you need to use this feature in WinForms app you can host WPF control with ElementHost

Reply all
Reply to author
Forward
0 new messages