Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
how to render a html file with help of c#
 
OP's additional text moved from non-solution below
WebBrowser control is very poor, it's using trident rendering engine of IE
Posted 9-Nov-12 6:59am
Edited 14-Nov-12 10:22am
Nelek49.7K
v2
Comments
BillWoodruff at 9-Nov-12 14:42pm
   
Render in what: a C# Windows Form, a WPF Window ... ?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

In Windows Forms, use a Windows Forms WebBrowser control[^]
In WPF, use a WPF WebBrowser control[^]
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hello,
 
The easiest solution is the WebBrowser control that has already been mentioned by ProgramFox, it works very well for most needs.
 
If you do not like it, have a look at http://awesomium.com/[^]
 
It's built on top of Webkit (Chrome or Safari), it is free if you are a small business or for non-profit.
 
Looking at the documentation, this is how you display a page:
 
using ( webView = WebCore.CreateWebView( 800, 600 ) )
{
    webView.Source = new Uri( "http://www.google.com" );
 
    while ( webView.IsLoadingPage )
        WebCore.Update();
 

    BitmapSurface surface = (BitmapSurface)view.Surface;
    surface.SaveToPNG( "result.png", true );
}
 
WebCore.Shutdown();
 
Enjoy Smile | :)
 
Valery.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

sing ( webView = WebCore.CreateWebView( 800, 600 ) )
{
webView.Source = new Uri( "http://www.google.com" );

while ( webView.IsLoadingPage )
WebCore.Update();

 
BitmapSurface surface = (BitmapSurface)view.Surface;
surface.SaveToPNG( "result.png", true );
}

WebCore.Shutdown();
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 thatraja 395
1 Sergey Alexandrovich Kryukov 295
2 Gihan Liyanage 261
3 kbrandwijk 204
4 CPallini 190
0 OriginalGriff 793
1 Sergey Alexandrovich Kryukov 604
2 Dnyaneshwar@Pune 604
3 Kornfeld Eliyahu Peter 530
4 thatraja 440


Advertise | Privacy | Mobile
Web01 | 2.8.140902.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100