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

Free Support Forum - aspose.com

Html as Stream input


While converting Word document to PDF we used the below code,

Aspose.Words.Document doc = new Aspose.Words.Document(stream) //stream is a word document stream

Aspose.Words.Saving.PdfSaveOptions pdfOptions = new Aspose.Words.Saving.PdfSaveOptions();

pdfOptions.PageCount = pageCount; //pageCount is 10

MemoryStream outMs =new MemoryStream();


Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(outMs)

////////Code to perform further operations////////////

Now I have HTML in a string variable //string inputHtml = SomeHTML

I want to convert this inputHtml to Pdf using the above approach(the one using for Word Documents)

I mean is there any Class like Aspose.Html.Document....????
or there is any other way


Hi Siddesh,

Thanks for contacting support.

HTML can be converted to PDF format either using Aspose.Words or using Aspose.Pdf for .NET.

Please visit the following link for required information on Convert HTML to PDF Format using Aspose.Pdf for .NET. In case the source contents are in String object, you may consider placing them inside PDF file (where you can create a new blank PDF file using Document doc = new Document(); code line) and then Add HTML String using DOM