Hi,
I tried to add RTL support for my html. I added the RTL tag to every object but didn't worked:
Thank you for you help.
I tried to add RTL support for my html. I added the RTL tag to every object but didn't worked:
var sb = new StringBuilder();
sb.Append(@"<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"" ""http://www.w3.org/TR/html4/loose.dtd"">
<html xmlns=""http://www.w3.org/1999/xhtml"" dir=""rtl"">
<head>
</head><body dir=""rtl"" style=""direction:rtl"">");
foreach (var item in data)
{
sb.Append(item.Content);
sb.Append("<br/></br><br/></br>");
}
sb.Append("</body></html>");
var css = HtmlRenderer.CssData.Parse("html { direction:rtl; text-align:right } body { direction:rtl; text-align:right } table { direction:rtl!important; }", true);
var img = HtmlRenderer.HtmlRender.RenderToImage(sb.ToString(), 600, cssData: css);
img.Save(Path.Combine(path, "file.jpg"));
I'm using the latest version (1.4.10).Thank you for you help.