Some questions
element to the end of an elements InnerHTML property every time the control was clicked on revealed that the control had to be clicked twice to insert two
elements before the control renders a single
and redisplays. Rendering to a different Graphics object using the IHTMLInput.Draw method We tried to see if we could use the IHTMLInput object returned from HtmlUIControl.Document to render to a different Graphics object and found that some of the rendered text on the right hand side was clipped, although we has first made the HtmlUIControl the same size as the Graphics object we were drawing on. We even made the control smaller but the problem would not disappear. Changing the border width We noticed that the HtmlUIControl always renders about 10 pixels away from the left of the control, is it possible to change this? Paddy.
Hi Davis,
Thank you for your responses, it’s nice to see that Syncfusion seem committed to extending the HtmlUIControl. Thank you for your example for drawing on another graphics object. It worked perfectly, I should have been clearer on what we were doing however. We were tying to draw on the graphics object of a page in the PrintPreviewDialog. Here’s the code we are using. I’ve escaped the html to avoid rendering this time.
private void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
// Use IInputHTML.Draw to draw on the page''s graphics object.
// adjust the dimentions of the control to match e.MarginBounds width & height.
// so that it renders to the correct dimentions.
htmluiControl1.Width = e.MarginBounds.Width;
htmluiControl1.Height = e.MarginBounds.Height;
// Give the HtmlUIControl somthing to render.
string html = "
The quick brown fox jumps over the lazy
dog." +
" The quick brown fox jumps over the lazy dog." +
" The quick brown fox jumps over the lazy dog." +
" The quick brown fox jumps over the lazy dog." +
" The quick brown fox jumps over the lazy dog." +
" The quick brown fox jumps over the lazy dog." +
" The quick brown fox jumps over the lazy dog." +
" The quick brown fox jumps over the lazy dog." +
" The quick brown fox jumps over the lazy dog." +
" The quick brown fox jumps over the lazy dog." +
" The quick brown fox jumps over the lazy dog." +
"
htmluiControl1.LoadFromString(html);
Syncfusion.Windows.Forms.HTMLUI.IInputHTML doc = htmluiControl1.Document;
Point startPoint = new Point(e.MarginBounds.X, e.MarginBounds.Y);
PaintEventArgs args = new PaintEventArgs(e.Graphics, e.MarginBounds);
doc.Draw(args, startPoint);
// Show the margins
e.Graphics.DrawRectangle(Pens.Red, e.MarginBounds);
e.HasMorePages = false;
}
We tried this code with three different printer drivers and a variety of different paper sizes. In most cases, the text on the far right gets clipped. This also happens if we produce a hard copy.
In your response about the html formatting issue (point 3) you state that the feature was added in a newer version. You then said "I will send you a version with this change along with the fixes for the other issues." Could you please clarify what you meant? Did you mean you''d send me a copy of the new control or not?
One final point, we noticed that when displaying mixed formatting on the same line, the text gets a lot of white space around it. Do you plan on fixing this problem?
Thanks again for taking the time to respond,
Paddy.
- Normal ITALIC normal
- 11 Replies
- 2 Participants
-
PA Paddy
- Feb 15, 2005 03:23 PM UTC
- Mar 4, 2005 12:11 AM UTC