Search code examples
aspose

How can I print data from a website which uses Aspose?


Not entirely sure how to word this so apologies if it doesn't make sense straight away.

I am on a website which I need to extract all the data from a specific object, it appears to be similar to an online e-book, something you'd see on a university library page etc.

I looked through the HTML and have seen that it uses Aspose:

<meta name="generator" content="Aspose.Words for .NET 15.5.0.0">

I was wondering if someone could give me advice or point me in the right direction so I can extract all the data from this online e-book into a pdf that I can use offline?

Thanks,


Solution

  • You can simply load the web page into Aspose.Words for .NET document object model (DOM):

    Document doc = new Document("abc.com/somepage.html");
    

    Once the web page is loaded into the Document object, you can choose to extract Selected Content Between Nodes in a Document or convert the entire web page to PDF format by using the following code:

    Document doc = new Document("abc.com/somepage.html");
    doc.Save(MyDir + @"17.6.pdf");
    

    Hope, this helps.

    I work with Aspose as Developer Evangelist.