Quantcast
Channel: HtmlRenderer Wiki & Documentation Rss Feed
Viewing all 73 articles
Browse latest View live

Updated Wiki: Home

$
0
0
Cross framework (WinForms/WPF/PDF/Metro/Mono/etc.), Multipurpose (UI Controls / Image generation / PDF generation / etc.), 100% managed (C#), High performance HTML Rendering library.

The library is 100% managed C# code without any external dependencies (no WebBrowser control, ActiveX / COM or MSHTML dll), the only requirement is .NET 2.0 or higher.

WinForms

Features and Benefits

  • Extensive HTML 4.01 and CSS level 2 specifications support.
  • Support separating CSS from HTML by loading stylesheet code separately.
  • Support text selection, copy-paste and context menu.
  • WinForms controls: HtmlPanel, HtmlLabel and HtmlToolTip.
  • WPF controls: HtmlPanel and HtmlLabel.
  • Works on Mono.
  • Create images from HTML snippets.
  • Handles "real world" malformed HTML, it doesn't have to be XHTML.
  • 100% managed code and no external dependencies.
  • Supports .NET 2.0 or higher including Client Profile.
  • Lightweight, just two DLLs (~300K).
  • High performance and low memory footprint.
  • Extendable and configurable.
  • Powerful Demo application to explore and learn the library.

WinForms/WPF controls

  • HtmlPanel - The full power of HTML control build to replace WebBrowser control, accepts HTML, text selection, scrollbars, link click intercept, image load intercept and much more.
  • HtmlLabel - As WinForms label but accepts HTML, text selection, auto-size capabilities, transparent background and more.
  • HtmlToolTip - As WinForms ToolTip control but accepts HTML and ability to handle links (WinForms only).

Sample application's

  • Render HTML content generated by rich web editors like forums, blogs, etc.
  • Render Office documents converted to HTML.
  • Create UI that requires text selection with clipboard support.
  • Create images from HTML code snippets (Image generation).
  • Create PDF document from HTML code snippets.

NuGet packages

Source

Authors


Updated Wiki: Documentation

$
0
0

Updated Wiki: FAQ

$
0
0
Why SVG images are not working?
.NET doesn't support SVG format.
A workaround is to convert SVG to PNG during rendering, see Rendering SVG images.

WPF support?
Yep, WPF is fully supported.

Mono support?
Yep, Mono is fully supported.

Silverlight support?
Not currently but as WPF supported it won't be too hard to add, care to contribute?

Metro, Xamarin, Unity or XNA support?
I believe it can be done and won't be very hard.
Is it something that enough people would like to see?

What about Java Script?
Java script is extremely hard to support so it is not on the road-map.

Why can't I navigate to a URL?
HTML Renderer is not a web-browser.

Can I generate image from HTML?
Yep, see Image generation.

Can I generate PDF document from HTML?
Yep, see PDF generation.
Currently powered by PdfSharp but it is quite easy to add more frameworks like iTextSharp

Can you sign the library with strong-name?
No, strong name is the devil (Strong Name signing is a huge religious war).
You can sign the dll yourself, see Adding a Strong Name to an existing DLL.

Can I contribute?
Sure! go to ArthurHub/HTML-Renderer on GitHub and fork away.


Updated Wiki: Documentation

$
0
0
Cross framework, Multipurpose, 100% managed (C#), High performance HTML Rendering library.

Navigation

Quick start

Install

Download the latest release zip, worth having around for the Demo application.
Either reference the proper DLL's from the downloaded release zip: HtmlRenderer.dll and one of: HtmlRenderer.WinForms.dll, HtmlRenderer.WPF.dll, HtmlRenderer.PdfSharp.dll. Note: add the targeted framework dlls you are targeting in your project, for PdfSharp you will also need to download PdfSharp dll.
Or, simply install the proper NuGet package using Visual Studio or command line:

WinForms HtmlPanel

In form (Form1) add the following:
publicpartialclass Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel htmlPanel = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel();
        htmlPanel.Text = "<p><h1>Hello World</h1>This is html rendered text</p>";
        htmlPanel.Dock = DockStyle.Fill;
        Controls.Add(htmlPanel);
    }
}

WPF HtmlPanel

In window (Window1) XAML add the following:
<Windowx:Class="Window1"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="Window1"Height="300"Width="300"xmlns:wpf="clr-namespace:TheArtOfDev.HtmlRenderer.WPF;assembly=HtmlRenderer.WPF"><Grid><wpf:HtmlPanelText="&lt;p&gt; &lt;h1&gt; Hello World &lt;/h1&gt; This is html rendered text&lt;/p&gt;"/></Grid></Window>

Generate Image

Add the following snippet in your main method: (for more advance usage see Image generation)
class Program
{
    privatestaticvoid Main(string[] args)
    {
        Image image = TheArtOfDev.HtmlRenderer.WinForms.HtmlRender.RenderToImage("<p><h1>Hello World</h1>This is html rendered text</p>");
        image.Save("image.png", ImageFormat.Png);
    }
}

Generate PDF

Add the following snippet in your main method: (for more advance usage see PDF generation)
class Program
{
    privatestaticvoid Main(string[] args)
    {
        PdfDocument pdf = PdfGenerator.GeneratePdf("<p><h1>Hello World</h1>This is html rendered text</p>", PageSize.A4);
        pdf.Save("document.pdf");
    }
}

Demo application

Updated Wiki: Documentation

$
0
0
Cross framework, Multipurpose, 100% managed (C#), High performance HTML Rendering library.

Navigation


Quick start

Install

Download the latest release zip, worth having around for the Demo application.
Either reference the proper DLL's from the downloaded release zip: HtmlRenderer.dll and one of: HtmlRenderer.WinForms.dll, HtmlRenderer.WPF.dll, HtmlRenderer.PdfSharp.dll. Note: add the targeted framework dlls you are targeting in your project, for PdfSharp you will also need to download PdfSharp dll.
Or, simply install the proper NuGet package using Visual Studio or command line:

WinForms HtmlPanel

In form (Form1) add the following:
publicpartialclass Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel htmlPanel = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel();
        htmlPanel.Text = "<p><h1>Hello World</h1>This is html rendered text</p>";
        htmlPanel.Dock = DockStyle.Fill;
        Controls.Add(htmlPanel);
    }
}

WPF HtmlPanel

In window (Window1) XAML add the following:
<Windowx:Class="Window1"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="Window1"Height="300"Width="300"xmlns:wpf="clr-namespace:TheArtOfDev.HtmlRenderer.WPF;assembly=HtmlRenderer.WPF"><Grid><wpf:HtmlPanelText="&lt;p&gt; &lt;h1&gt; Hello World &lt;/h1&gt; This is html rendered text&lt;/p&gt;"/></Grid></Window>

Generate Image

Add the following snippet in your main method: (for more advance usage see Image generation)
class Program
{
    privatestaticvoid Main(string[] args)
    {
        Image image = TheArtOfDev.HtmlRenderer.WinForms.HtmlRender.RenderToImage("<p><h1>Hello World</h1>This is html rendered text</p>");
        image.Save("image.png", ImageFormat.Png);
    }
}

Generate PDF

Add the following snippet in your main method: (for more advance usage see PDF generation)
class Program
{
    privatestaticvoid Main(string[] args)
    {
        PdfDocument pdf = PdfGenerator.GeneratePdf("<p><h1>Hello World</h1>This is html rendered text</p>", PageSize.A4);
        pdf.Save("document.pdf");
    }
}

Demo application

Demo application

Updated Wiki: Home

$
0
0
Cross framework (WinForms/WPF/PDF/Metro/Mono/etc.), Multipurpose (UI Controls / Image generation / PDF generation / etc.), 100% managed (C#), High performance HTML Rendering library.

The library is 100% managed C# code without any external dependencies (no WebBrowser control, ActiveX / COM or MSHTML dll), the only requirement is .NET 2.0 or higher.

WinForms

Features and Benefits

  • Extensive HTML 4.01 and CSS level 2 specifications support.
  • Support separating CSS from HTML by loading stylesheet code separately.
  • Support text selection, copy-paste and context menu.
  • WinForms controls: HtmlPanel, HtmlLabel and HtmlToolTip.
  • WPF controls: HtmlPanel and HtmlLabel.
  • Works on Mono.
  • Create images/PDFs from HTML snippets.
  • Handles "real world" malformed HTML, it doesn't have to be XHTML.
  • 100% managed code and no external dependencies.
  • Supports .NET 2.0 or higher including Client Profile.
  • Lightweight, just two DLLs (~300K).
  • High performance and low memory footprint.
  • Extendable and configurable.
  • Powerful Demo application to explore and learn the library.

WinForms/WPF controls

  • HtmlPanel - The full power of HTML control build to replace WebBrowser control, accepts HTML, text selection, scrollbars, link click intercept, image load intercept and much more.
  • HtmlLabel - As WinForms label but accepts HTML, text selection, auto-size capabilities, transparent background and more.
  • HtmlToolTip - As WinForms ToolTip control but accepts HTML and ability to handle links (WinForms only).

Sample application's

  • Render HTML content generated by rich web editors like forums, blogs, etc.
  • Render Office documents converted to HTML.
  • Create UI that requires text selection with clipboard support.
  • Create images from HTML code snippets (Image generation).
  • Create PDF document from HTML code snippets.

NuGet packages

Source

Authors

Updated Wiki: Demo application

Updated Wiki: Demo application


New Comment on "PDF generation"

New Comment on "Documentation"

$
0
0
Hi can anyone please give me the sample code snippet for use external css to generate pdf form HTML.

New Comment on "Documentation"

$
0
0
Hi Naimishmakwana, I needed this as well so I threw together a quick example https://github.com/DenisPitcher/HTML-Renderer/blob/master/Documentation/PDFGeneration.md Denis

New Comment on "PDF generation"

New Comment on "Documentation"

$
0
0
Hi! Great work on this!!! I have only one problem: One of my HTML contains inline images: <img alt="Image left : 12px, top : 0px" src="data:image/png;base64,iVBORw0KGgoAAAANAASUVORK5......CYII=" style="position:absolute;left:12px;top:0px;border-width:0px;"></div> Unfortunately the resulting image is completely blank (also the rest of the HTML is not converted). Am i missing some special configuration? I use plain an simple HtmlRender.RenderToImage(html); Any help is greatly appreciated! Michael
Viewing all 73 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>