Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified HtmlRenderer.nupkg
Binary file not shown.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ The library is **100% managed code** without any external dependencies, the only
1. 100% managed code.
3. No external dependencies.
3. Single and small dll (250K).
4. Supports .NET 2.0 and 3.0, 3.5, 4.0 client profile.
4. Supports .NET 2.0 and 3.0, 3.5, 4.0 client profile, 4.5 or higher.

**What it is not**
*

**Installing**
**NuGet package install**
1. PM> Install-Package HtmlRenderer.WinForms
2. Or from NuGet UI

**Manual install**
1. Download the binaries.
2. Reference the proper .NET release (2.0, 3.0, 3.5, 4.0, 4.5) in your project.

**Usage**
1. Drag-n-drop HtmlPanel, HtmlLabel or HtmlToolTip from the Toolbox.
2. Set the *Text* property with your html.
1. Add HtmlRenderer to Visual Studio Toolbox (drag-drop the dll on it).
2. Drag-n-drop HtmlPanel, HtmlLabel or HtmlToolTip from the Toolbox.
3. Set the *Text* property with your html.
4 changes: 3 additions & 1 deletion Source/Demo/DemoForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ private void LoadSamples()
{
using (StreamReader sreader = new StreamReader(resourceStream, Encoding.Default))
{
_samples[name] = sreader.ReadToEnd();
var html = sreader.ReadToEnd();
html = html.Replace("$$Release$$", _htmlPanel.GetType().Assembly.GetName().Version.ToString());
_samples[name] = html;
}

var node = new TreeNode(shortName);
Expand Down
26 changes: 13 additions & 13 deletions Source/Demo/HtmlRenderer.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,25 +148,25 @@
<None Include="Resources\web_pallete.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Samples\12.HtmlPanel.htm" />
<EmbeddedResource Include="Samples\10.HtmlPanel.htm" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Samples\10.HtmlLabel.htm" />
<EmbeddedResource Include="Samples\11.HtmlLabel.htm" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Samples\13.HtmlToolTip.htm" />
<EmbeddedResource Include="Samples\12.HtmlToolTip.htm" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Samples\03.Text.htm" />
<EmbeddedResource Include="Samples\02.Text.htm" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Samples\05.Images.htm" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Samples\07.Links.htm" />
<EmbeddedResource Include="Samples\04.Links.htm" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Samples\04.Tables.htm" />
<EmbeddedResource Include="Samples\03.Tables.htm" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Samples\20.About.htm" />
Expand All @@ -176,7 +176,7 @@
<SubType>Designer</SubType>
<DependentUpon>SampleForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Samples\09.Non standard.htm" />
<EmbeddedResource Include="Samples\07.Additional features.htm" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\image32.png" />
Expand All @@ -186,7 +186,7 @@
</ItemGroup>
<ItemGroup>
<None Include="Resources\method16.gif" />
<EmbeddedResource Include="Samples\14.HtmlRender.htm" />
<EmbeddedResource Include="Samples\13.HtmlRender.htm" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
Expand Down Expand Up @@ -221,21 +221,21 @@
<EmbeddedResource Include="TestSamples\18.Anchors.htm" />
<EmbeddedResource Include="TestSamples\31.ACID 1.htm" />
<EmbeddedResource Include="TestSamples\17.Languages.htm" />
<EmbeddedResource Include="Samples\06.Tooltip.htm" />
<EmbeddedResource Include="Samples\08.Tooltip.htm" />
<EmbeddedResource Include="TestSamples\16.Borders.htm" />
<Content Include="Resources\Event16.png" />
<Content Include="Resources\html.ico" />
<Content Include="Resources\html32.png" />
<EmbeddedResource Include="Samples\02.Using the code.htm" />
<EmbeddedResource Include="Samples\01.Background.htm" />
<EmbeddedResource Include="Samples\08.Embeded video.htm" />
<EmbeddedResource Include="Samples\09.Using the library.htm" />
<EmbeddedResource Include="Samples\01.History.htm" />
<EmbeddedResource Include="Samples\06.Embeded video.htm" />
<EmbeddedResource Include="TestSamples\15.MaxWidth.htm" />
<EmbeddedResource Include="TestSamples\14.Iframes.htm" />
<EmbeddedResource Include="TestSamples\30.Misc.htm" />
<EmbeddedResource Include="TestSamples\07.Background Image.htm" />
<EmbeddedResource Include="TestSamples\06.External Image.htm" />
<EmbeddedResource Include="TestSamples\11.LineHeight.htm" />
<EmbeddedResource Include="Samples\15.HtmlContainer.htm" />
<EmbeddedResource Include="Samples\14.HtmlContainer.htm" />
<EmbeddedResource Include="TestSamples\10.BlockInInline.htm" />
<EmbeddedResource Include="TestSamples\09.Inline.htm" />
<EmbeddedResource Include="TestSamples\13.Tables.htm" />
Expand Down
35 changes: 20 additions & 15 deletions Source/Demo/Samples/00.Intro.htm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1 align="center" style="color: white">
HTML Renderer Project
<br />
<span style="font-size: xx-small;">Release 1.4.6.2</span>
<span style="font-size: x-small;">Release $$Release$$</span>
</h1>
<blockquote class="whitehole">
<p style="margin-top: 0px">
Expand All @@ -19,23 +19,23 @@ <h1 align="center" style="color: white">
</td>
<td>
Everything you see on this panel (see samples on the left) is <b>custom-painted</b>
by the HTML Renderer. Including tables, images, links and videos.<br />
This project allows you can have the rich format power of HTML on you desktop applications
without <b>WebBrowser</b> control and <b>MSHTML</b>.<br />
The library is <b>100% managed code</b> without any external libraries dependencies,
the only requirement is <b>.NET 2.0 or higher</b>.
by the <b>HTML Renderer</b>, including tables, images, links and videos.<br />
This project allows you to have the rich format power of HTML on your desktop applications
without <b>WebBrowser</b> control or <b>MSHTML</b>.<br />
The library is <b>100% managed code</b> without any external dependencies, the only
requirement is <b>.NET 2.0 or higher</b>, including support for Client Profile.
</td>
</tr>
</table>
</p>
<h3>
Text selection (copy-paste)
Text selection (copy to clipboard)
</h3>
<div>
The rendered html has full support for <b>text selection</b> including <b>drag-and-drop</b>
and <b>copy</b> to clipboard of rich html and plain text to handle <b>paste</b>
operation to editor that support rich or/and plain text.<br />
Addtionally there is <b>context-menu</b> with select all, copy text, copy image,
Additionally there is a <b>context-menu</b> with select all, copy text, copy image,
save image, open link, copy link url, open video, copy video url.
</div>
<h3>
Expand All @@ -48,7 +48,7 @@ <h3>
<b>rounded corners</b>.
</div>
<h3>
WinForms support
WinForms controls
</h3>
<div>
It comes with handy WinForms controls (see <a href="ShowSampleForm">Sample Form</a>):
Expand All @@ -59,18 +59,23 @@ <h3>
auto size.</li>
<li><code>HtmlToolTip</code> - For ToolTip with rich html.</li>
</ul>
<h3>
Benefits
</h3>
<ul>
<li>100% managed code and no external dependencies.</li>
<li>Supports .NET 2.0 or higher including Client Profile.</li>
<li>Handles "real world" malformed HTML, it doesn't have to be XHTML.</li>
<li>Lightweight single dll (~250K).</li>
<li>High performance and low memory footprint.</li>
<li>Extendable and configurable.</li>
</ul>
<h3>
Limitations
</h3>
<div>
Here are some warnings that you should know when using the capabilities of the HTML
Renderer:
</div>
<ul>
<li>All HTML <b>end tags</b> marked as <a href="http://www.w3.org/TR/1999/REC-html401-19991224/index/elements.html">
optional</a> should be there. No problem with tags marked as forbidden.</li>
<li>When using rounded corners with borders, you must prevent the corner radius to be
larger than the border thickness</li>
</ul>
<hr />
<h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
</head>
<body>
<h1>
Background
History
</h1>
<blockquote>
<p>
For years, I <i>(Jose)</i> have been planning for a project like this. I prepared
my self quite well. I went through the entire CSS Level 2 specifiation along with
my self quite well. I went through the entire CSS Level 2 specification along with
the HTML 4.01 specification.
</p>
<p>
One of the most interesting things I found is this: Drawing HTML is no more than
laying out a bunch of boxes with borders margins and paddings. Once you overpass
laying out a bunch of boxes with borders margins and padding's. Once you overpass
this paradigm, everything else is to help the code actually place the boxes on the
right place, and then paint the string each box contains.
</p>
Expand All @@ -29,10 +29,20 @@ <h1>
all of the code on the library is managed code and the methods it use to paint are
quite basic. It draws lines, rectangles, curves and text.
</p>
<hr/>
<hr />
<p>
In October 2012 I <i>(Arthur)</i> was looking to replace the usage of WinForms WebBrowser
control by fully managed code...
control by something that can render complex html and have good performance and stability
characteristics. Obviously I was looking for fully managed solution preferably one that
I will have full control over.
</p>
<p>
HTML Renderer project showed great promise but had significant performance issues,
lacked many features (primary text selection) and wasn't updated for more than 3 years.
Realizing there is no alternative I embraced the project making it my baby.
</p>
<p>

</p>
</blockquote>
</body>
Expand Down
Loading