Code Monkey home page Code Monkey logo

html-renderer's Introduction

HTML Renderer Build status

Help Wanted

  • Looking for a contributor(s) to take this project forward as I'm unable to continue supporting it.
  • Contribute directly to the repository and update nuget packages.

Documentation, Discussion and Issue tracking is on CodePlex.

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.

Download the Demo application to explore HTML Renderer capabilities.

Renderer.png

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 WinForms UI that requires text selection with clipboard support.
  • Create images from HTML code snippets.
  • Create PDF document from HTML code snippets.

NuGet packages

HTML Renderer on my blog

TheArtOfDev / HTML Renderer

html-renderer's People

Contributors

arthurhub avatar configurator avatar cyotek avatar gyfke avatar helluvamatt avatar jeromerg avatar jfillbrook avatar licshee avatar mikkelxn avatar nikolaybobrovskiy avatar pawelmaj avatar redwyre avatar sbscomp avatar schdck avatar sergio73 avatar steck avatar swdriessen avatar vmlf01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

html-renderer's Issues

CSS FLOAT Property for Image Tags

Hey guys,

It seems that the PDF converter does not handle the float: left/right CSS property when applied in-line to image tags. This is very crucial as we could want business logos to align at a specific direction. Is there an alternative method to allow float behaviour for images?

Thanks in advanced!

Adhy

WpfAdapter Constructor Failed.

(WpfAdapter.cs)
AddFontFamily(new FontFamilyAdapter(family)); fail by a limited font.

An example of solution method.

            try
            {
                AddFontFamily(new FontFamilyAdapter(family));
            }
            catch
            {
            }

(HtmlContainerInt.cs)

Clear method fail by a null value.

An example of solution method.

    public void Clear()
    {
        if (null != _hoverBoxes)
        {
            _hoverBoxes.Clear();

            if (_root != null)
            {
                _root.Dispose();
                _root = null;
                if (_selectionHandler != null)
                    _selectionHandler.Dispose();
                _selectionHandler = null;
            }
        }
    }

GTK# control

Would/has anyone written a GTK# control for this?

ParseCssBlockProperties does not parse url attribute correctly

Due to failing to account for the existence of quoted strings for URL, fails to parse DATA urls due to the existence of a ';' in the string

eg
url('data:image/gif;base64,R0lGOD'); produces url('data:image/gif;

Implementation needs to allow for this in URL and for Font-Family at least

Page Break Issues

Hi all,

I've added a page-break-after: always attribute to a div element in the HTML string/snippet, to separate content and paging. The PDF converted should produce multiple pages, however, it does not. Is anyone able to see whether page break are handled, especially page-break-after CSS?

Thanks in advanced!

Regards,

Rahmadhy

LinkClicked event is eating Exceptions

Hello and thank you for this fantastic library. (Sorry for the cross-post with codeplex.com, not sure where you're following issues.)

One problem that I have is that when I raise an exception from within a LinkClicked event handler - the exception never makes it to my application-wide exception routines (Application.ThreadException and AppDomain.CurrentDomain.UnhandledException).

When I raise an exception from within any other control event handlers, the application-wide exception routines are notified.

This is because in HtmlContainer.ReportError, the code attempts to render the exception as HTML but if that fails too, the catch block eats the exception.

Instead of attempting to render errors as HTML, the code should simply allow those exceptions to be raised.

Exception: Could not load file or assembly 'HtmlRenderer, version=1.5.0.5'

Hello,

I am trying to convert html from a mail-body into PDF.

I have this code:

using PdfSharp;
using System;
using System.IO;
using TheArtOfDev.HtmlRenderer.PdfSharp;

namespace myNamespace.Services.Pdf
{
    public class PdfCreator : IPdfCreator
    {
        public byte[] CreateFromHtml(string bodyOriginal)
        {
            if (string.IsNullOrEmpty(bodyOriginal))
                return null;

            try
            {
                using (var outputStream = new MemoryStream())
                {
                    var pdf = PdfGenerator.GeneratePdf(bodyOriginal, PageSize.A4);
                    pdf.Save(outputStream);
                    var result = outputStream.ToArray();
                    pdf.Dispose();
                    return result;
                }               
            }
            catch (Exception ex)
            {
                return null;
            }
        }
    }
}

But always I call this CreateFromHtml function I got an exception:

Could not load file or assembly 'HtmlRenderer, Version=1.5.0.5, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

I am working with net framework 4.6.1 and I have installed HtmlRenderer with Nuget package.

I have tested the htmlrenderer.dll is in the bin folder.

Any help would be appreciated.

Incorrect Line Spacing on PDF Conversion

Hey guys,

I've generated a PDF document with line-height values on a few elements of the original HTML source. I'm also using ckEditor (http://ckeditor.com/) to generate the HTML mark up which will be used for the PDF generation. However, the result of the expected and actual outcome are different. The generated PDF seems to have a much large line-height/line spacing compared to the original. Is anyone having the same problem?

Regards,

Adhy


Attached is the HTML markup I'm attempting to convert to a PDF document.
LineSpacing_Test.txt

Table row styles are being striped when using HtmlRender.RenderToImage

Hello,

I have noticed a funny issue with a simple html when using HtmlRender.RenderToImage

<table>
         <tr  style="background-color:#4b266c;"><!-- I have tried  the following too.<tr bgcolor="#4b266c"> -->
          <td>
               <div >Hello World!</div>
          </td>
     </tr>
</table>

The styles on for the TR are not being respected and the background is white.

KC

Unable to render this html

"\r\n<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">\r\n<meta name="GENERATOR" content="MSHTML 8.00.6001.18702">\r\n\r\n\r\n

<font size="2" face="Arial"><span class="921220300-12102013">A  S. \r\n T "wr  Ts."
\r\n
<font size="2" face="Arial"><span class="921220300-12102013"> 
\r\n
<font size="2" face="Arial"><span class="921220300-12102013">Let me know if you need additional information.
\r\n
<font size="2" face="Arial"><span class="921220300-12102013">
\r\nThank you.
\r\n
<font size="2" face="Arial"><font size="2" face="Arial"> 
\r\n<div align="left">\r\n<div align="left"><font size="2"><font face="Arial">Joe Joe,\r\nAccount Manager\r\n<div align="left"><span style="FONT-SIZE: 11pt"><font color="#0080c0" size="2" face="Georgia">J & Joe Group\r\n<div align="left"><font size="1" face="Arial">ZZZZZ CA  ZZZZZ\r\n<div align="left"><font size="1" face="Arial">Phone / Fax\r\n<div align="left"><font size="1" face="Arial">Email: C<a title="blocked::mailto:[email protected]" href="mailto:[email protected]"><font title="blocked::mailto:[email protected]" size="1" face="Arial">[email protected]\r\n<div align="left"><font size="1" face="Arial"> \r\n<div align="left">\r\n<p style="MARGIN: 0in 0in 0pt" class="Section1"><span style="FONT-SIZE: 10pt"><font size="2"><span class="531310022-26032009"><span class="531542119-14042009"><font color="#808080" size="1" face="Arial">For the SIXTH consecutive year, the readers of\r\n Business

\r\n<p style="MARGIN: 0in 0in 0pt" class="Section1"><span style="FONT-SIZE: 10pt"><font size="2"><span class="531310022-26032009"><span class="531542119-14042009"><font color="#808080" size="1" face="Arial">Insurance\r\n<span class="531310022-26032009"><span class="531542119-14042009"><font color="#808080" size="1" face="Arial">have chosen as the best overall company company.\r\n<span style="FONT-FAMILY: 'Trebuchet MS','sans-serif'; COLOR: #262626; FONT-SIZE: 12pt">\r\n<a title="blocked::blocked::http://swett.com/pdf/BI10090Swett.pdf\nblocked::http://swett.com/pdf/BI10090Swett.pdf\nhttp://swett.com/pdf/BI10090Swett.pdf\" href="blocked::http://swett.com/pdf/BI10090Swett.pdf\"><span style="COLOR: #262626" title="blocked::blocked::http://swett.com/pdf/BI10090Swett.pdf\nblocked::http://swett.com/pdf/BI10090Swett.pdf\nhttp://swett.com/pdf/BI10090Swett.pdf\"><strong title="blocked::blocked::http://swett.com/pdf/BI10090Swett.pdf\nblocked::http://swett.com/pdf/BI10090Swett.pdf\"><em title="blocked::blocked::http://swett.com/pdf/BI10090Swett.pdf\nblocked::http://swett.com/pdf/BI10090Swett.pdf\"><font title="blocked::blocked::http://swett.com/pdf/BI10090Swett.pdf\nblocked::http://swett.com/pdf/BI10090Swett.pdf\" color="#808080" size="1">Click\r\n to read more!<span style="FONT-FAMILY: 'Trebuchet MS','sans-serif'; COLOR: #262626; FONT-SIZE: 12pt"><span style="FONT-FAMILY: 'Trebuchet MS','sans-serif'; COLOR: #262626; FONT-SIZE: 12pt"><font color="#808080" size="1">

\r\n<div class="Section1"><span class="531310022-26032009"><span class="531542119-14042009"><font color="#808080" size="1" face="Arial"><span style="FONT-FAMILY: 'Trebuchet MS','sans-serif'; COLOR: #262626; FONT-SIZE: 12pt"><span style="FONT-FAMILY: 'Trebuchet MS','sans-serif'; COLOR: #262626; FONT-SIZE: 12pt"><font color="#808080" size="1">Visit\r\n our website today at <a title="blocked::blocked::http://www.swett.com/\nblocked::http://www.swett.com/\nhttp://www.swett.com/\" href="blocked::http://www.swett.com/\"><span style="COLOR: #262626" title="blocked::blocked::http://www.swett.com/\nblocked::http://www.swett.com/\nhttp://www.swett.com/\"><strong title="blocked::blocked::http://www.swett.com/\nblocked::http://www.swett.com/\"><em title="blocked::blocked::http://www.swett.com/\nblocked::http://www.swett.com/\"><font title="blocked::blocked::http://www.swett.com/\nblocked::http://www.swett.com/\" color="#808080" size="1">www.swett.com  \r\n\r\n\r\n
 
\r\n\r\n"

Exception on Windows Universal

On windows universal there is no WebClient avaliable. It throws an exception inside SetHtml All referencesz should be converted to WebRequest.

Exception thrown: 'System.TypeLoadException' in HtmlRenderer.dll 
AppError:System.TypeLoadException: Could not load type 'System.Net.WebClient' from assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'. 
at TheArtOfDev.HtmlRenderer.Core.Handlers.ImageDownloader..ctor() 
at TheArtOfDev.HtmlRenderer.Core.HtmlContainerInt.SetHtml(String htmlSource, CssData baseCssData)

html to pdf rendering, text getting clipped

When a pdf is created from HTML, the text is not correctly rendered at the page break. The bottom line is clipped depending on the paragraph height hence reliable document rendering is an issue.

Preview of a pdf with clipped text.
text_clipping_issue

Can add Lib HTML-Renderer to services ?

Hi
Thanks you for project. I have a error when add lib to my project "windows services"

An unhandled exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll

Additional information: Could not load file or assembly 'HtmlRenderer, Version=1.5.0.6, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

how to fix it? Thanks.

HtmlRenderer.PdfSharp NuGet Can Cause Duplicated Package Install

The nuspec for HtmlRenderer.PdfSharp can cause PdfSharp to get installed twice into a solution/project. This happens if the user (such as myself) uses PdfSharp + MigraDoc, which is a package that includes both PdfSharp and MigraDoc, which work together and are from the same developers. MigraDoc requires PdfSharp and is not usable without it so there are no packages that include only MigraDoc. Therefore if you download the HtmlRenderer.PdfSharp version and already have MigraDoc installed, then you'll end up with two PdfSharp packages.

I'm not sure if there's a way to specify an OR dependency within a nuspec, but something like that would resolve the issue.

A temporary workaround is to install HtmlRenderer.PdfSharp (AFTER MigraDoc is installed) and run Uninstall-Package PDFsharp -Force. This will still allow the HtmlRenderer.PdfSharp version to function properly.

Guidance on how to implement Live Editing

Hi, I contacted you over on gitter also here:https://gitter.im/AvaloniaUI/Avalonia

I am investigating the possibility of adding a kind of Live editing mode, so you can edit the rendered html, and it will update the html source.

Its to form the basis of a kind of html based rich text control. Do you think you library could easily be extended to support this? Any pointers on how I could do it would be appreciated.

Page Number

I know that it is possible to count the pages and inject via C # using the features of PdfSharp, but is there any way to get this via HTML or CSS?

page-break-inside: avoid; - doesn't include <br/> tag

page-break-inside: avoid doesn't include <br/> tag inside <p></p> element during page height calculation. So page break doesn't work properly when <br/> element is used.

e.g. <p>Lorem ipsum dolor sit <br/> amet, consectetur adipiscing elit</p>

I would be grateful for fix

using Dictionary for caching causes multi-thread issues.

In RAdapter and FontsHandler, Dictionaries are used to cached brushes, pens and fonts.

Single instance pattern is used by PdfSharpAdapter, and this instance is used by all HtmlContainers generated during system running time.

It causes problem when using this single instance in a multi-thread environment. Refer Here

Please replace Dictionary with ConcurrentDictionary.

multiple line breaks inside font tag with br

The following html will not rendered correctly:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD></HEAD>
<BODY>
    <FONT face=Arial>
        <DIV>Line1<BR></DIV>
        Line2<BR>
        Line3 
        <DIV>Line4</DIV>
    </FONT>
</BODY>
</HTML>

I know this is very ugly html. This is from Microsoft Outlook.

Output: (the browser on the right is chrome)
20170523 114550

If you remove the first br tag (inside the div tag) it renders as expected

System.OutOfMemoryException when using HTMLPanel on Multi-Thread Application

Hello guys, right now I'm testing the HTMLPanel for my application and it must has multiples threads working together. But actually I'm getting the System.OutOfMemoryException.
After lots of tries and errors, I figure out memory isn't the problem. So here is what I got until now:

When creating a new thread executing the function Application.Run() with inline creation of Form's object, everything goes cool like this:

(new Thread(() => Application.Run(new Form1()))).Start();

the Form1 constructor only creates the HTMLPanel and render something:

public Form1()
{
    InitializeComponent();

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

But when I first create the object and then I pass the object on a function, I get the error:

Form1 form = new Form1();
(new Thread(() => Application.Run(form))).Start();

Here is the full exception message:
An unhandled exception of type 'System.OutOfMemoryException' occurred in System.Drawing.dll

I have no idea what's going on behind the scenes through the windows memory, and if someone's may help me, I will be really grateful. Thanks community, that's a powerful HTML tool for C#.

EDIT:
Well, some weeks ago I discovered the problem happens when trying to access the Panel from another thread, it's a common Cross-Thread exception but since the Panel is inside an form, the Debuger reports a different message.
I solved my problem for a while creating the Form inside the new thread like:

(new Thread(() => CreateForm()).Start();

Then:

CreateForm()
{
    Application.Run(new Form1());
}

So if the HTML Renderer's developer sees this Issue, probably the problem it's located on Multi-Thread treatment.
I hope I help with something.

text-align:justify breaks words in tags

When using text-align:justify the renderer leaves spaces before and after every tag
for example the text:

The HTMLrenderer Lorem ipsum dolor sit amet, per ex melius deserunt perpetua. Sed in mucius ancillae, per sint equidem in. Qui ne ceteros eleifend omittantur. Sea natum appellantur an, ex sit autem adversarium. Suas aliquam deserunt cu mei

is renderered as

The HTML rend erer Lorem ipsum dolor sit amet, per ex melius deserunt perpetua. Sed in mucius ancillae, per sint equidem in. Qui ne ceteros eleifend omittantur. Sea natum appellantur an, ex sit autem adversarium. Suas aliquam deserunt cu mei

--------------------------

This happens when the **tag ** (in the example **Bold**) is in all but the last line

PrintDocument graphics gdi+ vs gdi issue (winforms)

Hi,
It seems like something is off with regular gdi rendering in the current version. Seems like it is being output at an extremely small resolution, even though I'm passing the correct margin data.

Here's a ghetto phone pic of my printed output:
http://imgur.com/a/X2J44

Here are the statements I'm using:
HtmlRender.Render(printerGraphics, html, (float)printedMarginArea.Left, (float)printedMarginArea.Top, (float)printedMarginArea.Width);
HtmlRender.RenderGdiPlus(printerGraphics, html, (float)printedMarginArea.Left, (float)printedMarginArea.Top, (float)printedMarginArea.Width);

The regular "render" method appears to be scaling correctly in 1.3.0, but I'm missing too much functionality to be able to use that version. I'm trying to poke around the source code but I'm not able to find the disconnect...

Appreciate it!

Allow issue tracking on github

Allowing issue tracking on github would allow easy tracking of issues, fixes and their corresponding pull requests or code changes.

HTML being cut off in PDF

I am rendering a very simple invoice and it is cutting off HTML in the middle of the page when I set page top and bottom margins. When the margin is removed it seems to sort itself out. Can send html it's trying to parse if that would help

A typo in RoutedEvenArgs.cs

I found a typo when I was developing the program with HtmlRenderer. The name of the class should be RoutedEventArgs instead of RoutedEvenArgs in RoutedEvenArgs.cs . I would appreciate if somebody could fix it.

Interested in continue supporting for this project

First of all, thank you for the great job you have done!
Me and a several friends definitely need pure managed HTML rendering engine, that's why we looked into this.
What requirements do you want us to meet?

Acrobat Reader DC Open Error Dialogue - "An error exists on this page..."

Hi guys,

When I convert my HTML to PDF and try opening it in Acrobat Reader DC, an error dialogue shows, saying "An error exists on this page. Acrobat may not display the page correctly..." I've done a little bit of research and the potential problem is from the conversion of the HTML string. If there are inline characters "\n" this should be encoded using Converter.ToBase64String then decoded using Converter.FromBase64String, instead of Encoding.UTF8, etc.

Please let me know if anyone is able to change the source code for this and publish it to the next version.

Regards,

Adhy

Breaking table issue

Currently if table row exceeds page's borders, it moves to the next page. And if it is the second row in a table, the whole table moves to the next page to not split header and table body.
But if first and second row's cumulative height is more than page's height, it goes into infinite moving to the next page

Blurry text (WPF)

I'm trying to display basic html elements in a HTML Label. No html tag, body tag, or css style sheet. Just P, UL, LI elements. However, when shown on screen the text isn't sharp and is uncomfortale to read.

Any suggestions?

Only one page shown SOMETIMES when using tables.

This is a weird one, and I'm having some trouble isolating exactly what inputs cause the issue. Basically, I have a table to show some data, followed by a list of images. The combined length of the table and the images is over one page long (actually, the length of the images alone that I've been testing with is over one page long). If I convert the whole thing, only the first page is shown. Other pages exist (and sometimes are landscape oriented for some reason), but they're blank. If I display just the list of images, they display fine on all pages. If I comment out certain things in the table, the content shows properly on both pages. So far, it seems like the issue only shows itself in two cases: 1, when there are tags inside of a td (as per https://htmlrenderer.codeplex.com/workitem/9094); 2, when there is only empty space (spaces or tabs) inside of a td. Any idea what's up?

External CSS

Im trying to write an application which converts HTML to PDF.
I have tried to cram it all in one string HTML and CSS but it does not seem to like it.
I noticed there is a way to add external CSS to the generatepdf command, however i have no idea how to create the CSSdata properly, does anyone know? i cannot seem to find any documentation on it either..

Location not working for negative values, gets pushed to 0

Hi, I am trialling this and so far it's awesome. Just found one thing though trying to render HTML into a custom List Box and sometimes (for items at the top) painting needs to start at a location with a -Y for a partially drawn list item. I believe that I have found the problem and here is my fix, so far it seems OK (the Demo still looks all good).

In Layout cells there are some calls to Math.Max where the 2nd param is 0, it should be the existing Location value.

private void LayoutCells(RGraphics g)
{
double startx = Math.Max(_tableBox.ClientLeft + GetHorizontalSpacing(), _tableBox.Location.X);
double starty = Math.Max(_tableBox.ClientTop + GetVerticalSpacing(), _tableBox.Location.Y);
....
}

HTMLRenderer PDF Bookmark Support

We're looking into using htmlrenderer for our solution and so far we love it, but so far we're unsure of how to add support for bookmarks in pdf. I saw that PDFsharp had it, but I wasn't sure if you also supported it or if you knew of a way to access that functionality.

Foreground color from Control

Is there any way to set font color from the control?

<wpf:HtmlPanel Text="{Binding Title}"  Background="Transparent" Foreground="White">
</wpf:HtmlPanel>

By default, it applies Black as Foreground, (Foreground="White" is not applied)

Multithreading support

This is a feature request.

It would be awesome to have multithreading support (make methods as like HtmlRender.RenderToImage thread-safe).
I mean possibility to use current library methods for generating batches of pictures.
(For example call RenderToImage inside Parallel.For and etc.)

Image Gif is not work

Thanks a lot for your job
It is so fantastic
but can you fix this
Image Gif is not work
Thanks

Implement table borders overriding rules

https://www.w3.org/TR/CSS2/tables.html#border-conflict-resolution

  1. Borders with the 'border-style' of 'hidden' take precedence over all other conflicting borders. Any border with this value suppresses all borders at this location.
  2. Borders with a style of 'none' have the lowest priority. Only if the border properties of all the elements meeting at this edge are 'none' will the border be omitted (but note that 'none' is the default value for the border style.)
  3. If none of the styles are 'hidden' and at least one of them is not 'none', then narrow borders are discarded in favor of wider ones. If several have the same 'border-width' then styles are preferred in this order: 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and the lowest: 'inset'.
  4. If border styles differ only in color, then a style set on a cell wins over one on a row, which wins over a row group, column, column group and, lastly, table. When two elements of the same type conflict, then the one further to the left (if the table's 'direction' is 'ltr'; right, if it is 'rtl') and further to the top wins.

Method not found: 'Void TheArtOfDev.HtmlRenderer.Core.HtmlContainerInt.SetMargins(Int32)'.

Error:

Method not found: 'Void TheArtOfDev.HtmlRenderer.Core.HtmlContainerInt.SetMargins(Int32)'. 
Instances of this error (10)  
1.   Hide Call Stack 
at TheArtOfDev.HtmlRenderer.WinForms.HtmlContainer..ctor()
at TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel..ctor() in myFolder\HtmlRenderer.WinForms\HtmlPanel.cs:line 121

I was using HTML-Renderer for few weeks now and I have no problems before, but now instead of opening design of Forms with HtmlPanel in it, this weird error is there for each HtmlPanel in Form.
Application can be started and debugged step by step to HtmlContainer line 56: _htmlContainerInt.SetMargins(0); to HtmlContainerInt line 454:

public void SetMargins(int value)
        {
            if (value > -1)
                _marginBottom = _marginLeft = _marginTop = _marginRight = value;
        }

Everything is OK application run normally. At run time if found method as expected, even F12 Go To Definition work.
But designer not work, I already try to clean solution, rebuild, reboot system.
Thanks in advance for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.