{"id":20562168,"url":"https://github.com/fsdsabel/tinyhtmlwpf","last_synced_at":"2026-03-09T20:04:35.063Z","repository":{"id":82641897,"uuid":"86980702","full_name":"fsdsabel/TinyHtmlWpf","owner":"fsdsabel","description":"TinyHtml.Wpf is a WPF HTML rendering library based on litehtml. It provides the rendering backend for WPF. Contrary to similar libraries it uses native WPF drawing to render texts, images and other stuff. So it is fully capable of doing high dpi and blends seemlessly with other content.","archived":false,"fork":false,"pushed_at":"2021-01-08T11:17:38.000Z","size":262,"stargazers_count":34,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-29T16:44:35.396Z","etag":null,"topics":["csharp","html","library","wpf"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fsdsabel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-02T11:03:38.000Z","updated_at":"2024-06-21T17:52:03.439Z","dependencies_parsed_at":null,"dependency_job_id":"d33e4b86-b984-41fd-a3eb-240a7f221d51","html_url":"https://github.com/fsdsabel/TinyHtmlWpf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsdsabel%2FTinyHtmlWpf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsdsabel%2FTinyHtmlWpf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsdsabel%2FTinyHtmlWpf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsdsabel%2FTinyHtmlWpf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fsdsabel","download_url":"https://codeload.github.com/fsdsabel/TinyHtmlWpf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248895439,"owners_count":21179236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","html","library","wpf"],"created_at":"2024-11-16T04:09:29.975Z","updated_at":"2026-03-09T20:04:35.011Z","avatar_url":"https://github.com/fsdsabel.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TinyHtml.Wpf\n## Introduction\nTinyHtml.Wpf is a WPF HTML rendering library based on [litehtml](https://github.com/litehtml/litehtml).\nIt provides the rendering backend for WPF. Contrary to similar libraries it uses native WPF drawing to \nrender texts, images and other stuff. So it is fully capable of doing high dpi and blends seemlessly with\nother content.\n\nOriginally it was developed by me to replace HTMLayout that we used before. However text rendering\nwas always blocky and didn't blend well with other WPF content. We use this extensively for dynamic formatted text that \nis authored as HTML.\n\nThis library does not provide scripting capabilities or very advanced HTML. It proved to be quite\ncapable nonetheless.\n\nA [Nuget package](https://www.nuget.org/packages/TinyHtml.Wpf) can be found on nuget.org. It supports\nx86 and x64 (or AnyCPU) applications.\n\n## Release Notes\n\n### 1.2.2.0\n- .NET 5.0 build\n- Fixes possible access violation if control is unloaded while mouse cursor is inside of control\n\n### 1.2.1.0\n- .NET Core 3.0 build\n- Upgrade to Visual Studio 2019\n\n\n### 1.2.0.0\n- New virtual method `OnAnchorClicked` for `WpfHtmlControlBase` that allows interception of user clicks on links.\n\n## Requirements\n- .NET 4.6 or .NET Core 3.0\n- A WPF application\n- Visual Studio 2019 for building\n\n## Supported features\n- WPF Text rendering\n- HTML Tables\n- HTML Lists\n- Images\n- css\n- and much more...\n\n## Building\n1. Get sources from https://github.com/fsdsabel/TinyHtmlWpf:\n\u003cbr/\u003e\u003cpre\u003e\u003ccode\u003egit clone --recursive https://github.com/fsdsabel/TinyHtmlWpf.git\u003c/code\u003e\u003c/pre\u003e\n2. Open the Solution TinyWpfHtml.sln in Visual Studio 2019\n3. Compile configuration Release - x86\n4. Compile configuration Release - x64\n5. Binaries should be in **Bin** directory and **HtmlTestApp** should run\n\n## Usage\nBasically there is only one class you need. It is `WpfHtmlControl` which is subclassed from a standard\nWPF `Control`. This control loads a default master style sheet. If you want a custom one, you can derive from\n`WpfHtmlControlBase` and load your own.\n\nThe master style sheet is used for all the default HTML elements like paragraphs or bold elements. For example you could do something like this:\n\n```csharp\npublic class MyWpfHtmlControl : WpfHtmlControlBase\n{\n    static MyWpfHtmlControl()\n    {\n        using (var s = typeof (MyWpfHtmlControl).Assembly.GetManifestResourceStream(typeof (MyWpfHtmlControl), \"master.css\"))\n        {\n            SetMasterStylesheet(new StreamReader(s).ReadToEnd());\n        }\n    }\n}\n```\n\nYou would then use `MyWpfHtmlControl` in your application. \n\nThe most basic usage of a `WpfHtmlControl` would be:\n\n```xml\n\u003clocal:WpfHtmlControl Background=\"Blue\" Foreground=\"Red\" FontSize=\"16\" \n                      Html=\"\u0026lt;b\u0026gt;Hello world!\u0026lt;/b\u0026gt;\"\u003e\u003c/local:WpfHtmlControl\u003e\n```\n\nIt is possible to bind to the `Html` property to update the displayed HTML dynamically.\n\nIf you want to display images, you have to override `OnLoadResource`.\n\n## License\nCopyright (c) 2020, Daniel Sabel  \nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without  \nmodification, are permitted provided that the following conditions are met:  \n- Redistributions of source code must retain the above copyright  \n      notice, this list of conditions and the following disclaimer.  \n- Redistributions in binary form must reproduce the above copyright  \n      notice, this list of conditions and the following disclaimer in the  \n      documentation and/or other materials provided with the distribution.  \n- Neither the name of the \u003corganization\u003e nor the  \n      names of its contributors may be used to endorse or promote products  \n      derived from this software without specific prior written permission.  \n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND  \nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED  \nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE  \nDISCLAIMED. IN NO EVENT SHALL \u003cCOPYRIGHT HOLDER\u003e BE LIABLE FOR ANY  \nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES  \n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  \nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND  \nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  \n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS  \nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n**This library uses litehtml:**\n\nCopyright (c) 2013, Yuri Kobets (tordex)  \nAll rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsdsabel%2Ftinyhtmlwpf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffsdsabel%2Ftinyhtmlwpf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsdsabel%2Ftinyhtmlwpf/lists"}