How to display HTML data on Aspose.Note page using C#

I want to display HTML data on Aspose.Note page using C#. Just consider that HTML data is in variable. Please help.

@SurinderH,

You can paste HTML string/data as rich text on the OneNote document page. See the following sample code for your reference.
e.g.
Sample code:

// Create an object of the Document class
Aspose.Note.Document doc = new Aspose.Note.Document();
// Initialize Page class object
Aspose.Note.Page page = new Aspose.Note.Page();
// Initialize Outline class object
Aspose.Note.Outline outline = new Aspose.Note.Outline();
// Initialize OutlineElement class object
Aspose.Note.OutlineElement outlineElem = new Aspose.Note.OutlineElement();

// Initialize TextStyle class object and set formatting properties
Aspose.Note.ParagraphStyle textStyle = new Aspose.Note.ParagraphStyle { FontColor = System.Drawing.Color.Black, FontName = "Arial", FontSize = 10 };
//Set the HTML string
string html = "<font style=\"font-size:11.5pt\">Test string</font>";
// Initialize RichText class object and apply text style
Aspose.Note.RichText richText = new Aspose.Note.RichText() { Text = html, ParagraphStyle = textStyle };

// Add RichText node
outlineElem.AppendChildLast(richText);
// Add OutlineElement node
outline.AppendChildLast(outlineElem);
// Add Outline node
page.AppendChildLast(outline);
// Add Page node
doc.AppendChildLast(page);

// Save OneNote document
doc.Save("g:\\test2\\out1.one");

Hope, this helps a bit.

Thanks Amjad.

There is some issue. Please check the attached zip file.
SampleText-26.zip (2.3 KB)

@SurinderH,

I checked the output OneNote document and the HTML tags are pasted there. Do you need to parse HTML tags by Aspose.Note on the document page?

Thanks Amjad.

Yes, I want to parse HTML tags by Aspose.Note on the document page.

@SurinderH,

Aspose.Note may not parse HTML to display the formatted data on OneNote document page. We need to evaluate your desired feature in details.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): NOTENET-5835

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thanks Amjad.

@SurinderH,

You are welcome. We will keep you posted with updates once available on it.

@SurinderH,

We evaluated your desired feature in details. As a quick solution, we can offer it in two steps: i.e., first convert from HTML to PDF and then import from PDF to OneNote document.

We will try to support this action without unnecessary complications in the next release, version v24.4, which is due in the next month.

We hope this information helps you.

Thanks Amjad. I’ll try but I can wait until the next release.

@SurinderH,

You mean you will try those two steps we mentioned yourself for your task now instead of waiting for the next release (which will incorporate the proposed feature) to come out? If you can, you may try the workaround for the time being if it fits your requirements.

Let us know if you encounter any issues or have any other queries.

Hi Amjad, I prefer to wait for next release.

@SurinderH,

Alright, once we publish the next (supported) version, we will notify you.

Hi Amjad, Kindly let me know when the new version will be released.

@SurinderH,

Aspose.Note for .NET v24.4 has not been published yet. It will be released later this month. We cannot share the exact date as releases are published once they are ready. You can expect it to be available in the last or second last week of this month. You will be notified once the supported version is published.

Thanks Amjad.

@SurinderH,

You are welcome.