This project is read-only.

Render to Graphics

Oct 7, 2013 at 7:34 AM
Edited Oct 7, 2013 at 8:05 AM
Hi, I would like to use HtmlRender.Measure and HtmlRender.Render static functions to render html code to my Graphics object. Everything is ok, but the result is too small. For example, I use this rendered Graphics for printing, and the result covers just about 5% of page, text is too small. I have tried to set different kinds of max width, but it has no effect on how the output is scaled. Is there any way how to set proper rendering scale? My ciode looks like this:
SizeF size = HtmlRender.Measure(e.Graphics, TextToPrint, printWidth);
size = HtmlRender.Render(e.Graphics, TextToPrint, leftMargin, topMargin, printWidth);
I have also tried to render first into a bitmap image (as described in demo application), but the same problem appeared. The output image resolution was too tiny or no antialias was used, so that the text was nearly unreadable. Result looks like this.
Oct 7, 2013 at 12:04 PM
Image rendering is a known issue that I'm working on.
I'm not sure hot rendering into different graphics object will work as I never done it, if you use WinForms TextRenderer does it works properly?
Oct 8, 2013 at 7:44 AM
I have switched to the version 1.4.3 which solved the problem. I am using HtmlRender.Render function in System.Drawing.Printing.PrintDocument.OnPrintPage method since I need to render and print html.