How to extract Text from html using Aspose.html

We are currently checking Aspose.html to get plain text with alignment from html and convert html to PDF.
able to convert html to pdf.
Wanted to know how to get text from html.?

@kiranernesto

You can get text from HTML document using following code snippet:

using (var document = new Aspose.Html.HTMLDocument(htmlFile))
{
 var text = document.DocumentElement.InnerHTML;
}

Please let us know in case you have further inquiry.

@asad.ali Thank you for the ans.

1 Like

Hi,

this approach extract the raw text (HTML Markup).

What if I need the text that I would see in the browser when I load the HTML?

Regards,
Andy

@AStelzner

We need to investigate this feature in details. Can you please share the sample HTML for our reference with the details of the text that you want to extract using Aspose.HTML?

I opened a new issue: Extract visible/rendered Text from HTML

@AStelzner

We have responded you there to gather some more details. You can please carry on the discussion there.