We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Some questions

Hi there, We are currently evaluating the HtmlUIControl. However, we came across some issues that we were unable to solve. Any help in answering these questions would be greatly appreciated. On with the questions: Hyperlink Navigation When a string of html containing bookmarks and hyperlinks to those bookmarks is using in the HtmlUIControl, the hyperlinks will not navigate to the bookmarks, they return to the top of the document instead. E.G.: New Page

Hyperlink


Bookmark

Additionally, the bookmark elements render as hyperlinks. Cancelling navigation We are unable to determine if it is possible to prevent navigation of a hyperlink taking place. We would like to allow a user to click on a hyperlink and rather than navigation occurring, cancel navigation and perform some other action ourselves. The reason for this is that we would like to use the Internet Explorer ActiveX control to display pages that the HtmlUIControl has trouble rendering. Adding html to a document being displayed Adding html elements by adding text to the InnerHtml property of an IHTMLElement object does not seem to work. For instance if I want to make an elements text italic I do this; IHTMLElement element = htmlUIControl1.Document.GetElementByUserId("myID"); element.InnerHTML = "" + element.InnerHTML + ""; However, this change is not registered in the control. If I look at the Xml document returned from HtmlUIControl.Document.Document, I can see the newly added element. If I examine the string returned from HtmlUIControl.Text, I can see the element with it''s xSize, xLocation and xVisible attributes assigned. However, if I use HtmlUIControl.Document.GetElementsByNameHash(), I cannot see the new element in the hashtable. A simplified version that adds a
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.

11 Replies

DJ Davis Jebaraj Syncfusion Team February 16, 2005 09:34 AM UTC

Hi Paddy, Thank you for your interest in Essential HTMLUI. I am working on the issues you have raised and I will respond to them within the next few hours. Thank you for your patience. Regards, Davis


PA Paddy February 16, 2005 11:36 AM UTC

Hi Davis, thanks for letting me know, I see that my examples of html got rendered in my message. If you need clarification on any point, don’t hesitate to ask. Paddy.


DJ Davis Jebaraj Syncfusion Team February 18, 2005 09:59 AM UTC

Hi Paddy, Sorry about the delay in responding. 1. Bookmarks: Thank you for bringing this issue to our attention. I have informed the development team about this problem and they should be adding support for bookmarks. 2. Cancelling navigation: I am working on this issue. I will update this thread again. 3. Adding html to a document being displayed: To change the formatting of an element, we support applying HTMLformat objects to the HTMLElements directly. This feature was added recently and is not available in the public version. I will send you a version with this change along with the fixes for the other issues. We will also rectify the problem with the InnerHTML property not being updated properly. 4. Rendering to a different Graphics object using the IHTMLInput.Draw method: I am working on this issue. I will update this thread again. 5. Changing the border width: Yes. We will change the behavior so that it is aligned to the left and also make it configurable. Thank you for your patience. Regards, Davis


DJ Davis Jebaraj Syncfusion Team February 19, 2005 12:10 AM UTC

Hi Paddy, An update regarding issue 2: Cancelling navigation. There is currently no way to do this. We will add a event that allows intercepting and cancelling the link click action. We will also add support for a URILoader model so that any type of URI can be handled as needed by the developer. Item 5: Rendering to a different Graphics object. Could you please try this code at your end and let me know: Image img = new Bitmap(this.htmluiControl1.AutoScrollMinSize.Width , this.htmluiControl1.AutoScrollMinSize.Height ); Graphics g = Graphics.FromImage (img); IInputHTML doc = this.htmluiControl1.Document; PaintEventArgs ea = new PaintEventArgs(g,new Rectangle(0,0,img.Width,img.Height)); doc.Draw(ea,Point.Empty); Clipboard.SetDataObject( img ); Thanks, Davis


PA Paddy February 21, 2005 12:05 PM UTC

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.



DJ Davis Jebaraj Syncfusion Team February 22, 2005 04:41 PM UTC

Hi Paddy, Issue 4: Rendering to a different graphics object. I see the problem when the HTMLUI Control itself is wider than the PrintPreviewPage. We will fix this issue at the earliest. Issue 3: Changing formatting through HTMLFormat objects. This feature was implemented recently and I was saying that it will be included in the patch build I am planning to send to you with some additional changes. I will send the build within the next few days. Issue 6: Mixed formatting space. Yes. we are already working on this issue and it should be fixed. Thank you for your patience. Regards, Davis


PA Paddy February 25, 2005 09:23 AM UTC

Hello Davis, Thank you once again for your reply. We would like to take you up on your offer of a more up to date version of the control as long as it does not cause any licensing issues. We’re still using the trial version. It looks like we shall be purchasing the control though, and the decision to was influenced in no small part by the help we have received on your forum. Thanks, Paddy.


DJ Davis Jebaraj Syncfusion Team February 25, 2005 11:28 PM UTC

Hi Paddy, Thank you for your continued interest in Essential HTMLUI. I will send you the updated build by tomorrow (or Monday) with a key for resolving the licensing key also through email. Regards, Davis


DJ Davis Jebaraj Syncfusion Team March 1, 2005 02:40 PM UTC

Hi Paddy, Sorry for the delay. I will send you the patch version with the key today. Regards, Davis


PA Paddy March 2, 2005 09:50 AM UTC

Hi Davis, Thanks for keeping me up to date with the newer build. I thought you should know that we have purchased the full version of the control, we are still interested in the version your going to send us though.   By the way we found a problem when rendering an html document that’s got some non html elements in it. Here’s an example:
  • Normal ITALIC normal
This document will render, but if I add i elements around the the word ITALIC, the document will not render at all. Remove the NonHtml tags and the document will render again. Thanks for all your help, Paddy.


DJ Davis Jebaraj Syncfusion Team March 4, 2005 12:11 AM UTC

Hi Paddy, I have been able to reproduce the problem you have reported. We will fix this issue at the earliest. Sorry for the delay in sending you the build as promised. I will send it over as soon as it is available. Thanks and regards, Davis

Loader.
Live Chat Icon For mobile
Up arrow icon