We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert wingding check mark in html

Hi,

We have a requirment that needed to insert a wingding check mark before exporting it to word or pdf… the whole content is in html.

the problem is when i add "\xf0fc" into my html it didnt convert into wingding check mark after converting the whole html blcok to pdf and word… is there any approach for this to be possible?

Hi Joebet,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. If you convert your HTML to Word document using MS Word, you will get the same output.

In order to insert a Symbol using Aspose.Words, you must know it’s hex or decimal code. You can find the Symbol character code inside Insert Symbol dialogue in Microsoft Word. Once you know the Symbol code, you can use the following code to insert it using Aspose.Words:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert symbol.
builder.PushFont();
builder.Font.Name = "Wingdings";
builder.Font.Size = 20;
builder.Writeln("\xf0fc");
builder.PopFont();
doc.Save(MyDir + "Out.docx");

Could you please attach your input HTML document here for testing? I will investigate the issue on my side and provide you more information.

Hi Tahir,

heres our whole html. http://pastebin.com/ncjdaigK we needed to replace “” which is a check image to wingdings check mark… is there any way to acoomplish this? since the whole html code is system generated.

Hi Joebet,

Thanks for your inquiry. In your case, I suggest you please use alt property of IMG tag as shown below.

<img src="http://localhost/App_Themes/Theme1/images/check.png" alt="check">

Once you have set the alt property of IMG tag, please use the following code snippet to achieve your requirement. Hope this helps you.

Document doc = new Document(MyDir + "in.html");
DocumentBuilder builder = new DocumentBuilder(doc);
foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true))
{
    if (shape.AlternativeText == "check")
    {
        builder.MoveTo(shape);
        builder.PushFont();
        builder.Font.Name = "Wingdings";
        builder.Font.Size = 20;
        builder.Writeln("\xf0fc");
        builder.PopFont();
        shape.Remove();
    }
}
doc.Save(MyDir + "Out.docx");