Free Support Forum - aspose.com

HTML writer to PDF

Is there a code sample to convert HtmlTextWriter memory stream to PDF.

@cnayak

Thanks for contacting support.

You may use file path as well as memory stream as an argument in Document constructor, in order to convert HTML into PDF. Please consider using following code snippet:

HtmlLoadOptions loadOptions = new HtmlLoadOptions();
Document doc = new Document(HtmlMemoryStream, loadOptions);
doc.Save("C:\\PDFOutPut.pdf");

In case of any further assistance, please feel free to let us know.