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

Free Support Forum - aspose.com

Can aspose take html and save it as a pdf?

I’m evaluating the trial version for out needs. I see mentioned in the features list that it can “handle” html among other things and I know it can save a document as a pdf. My question is, can you create a new aspose document, load it with html, then save it as a pdf. If this is possible, could I see some code on how to insert the html into the document?

Thanks,
Rut

Hi

Thanks for your request. Yes, of course you can do it with Aspose.Words, but y
ou should note that Aspose.Words was originally designed to work with MS Word documents. That is why upon processing HTML some features of HTML might be lost. You can find a list of limitation upon exporting/importing to HTML here:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/save-in-the-html-format.html

Please, see the following code:

// Load HTML

Document doc = new Document(@"in.html");

// Save output document

doc.Save(@"out.pdf");

Also please follow this link to learn more about InsertHtml method:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.documentbuilder.inserthtml.html

Hope this helps.

Best regards,