Free Support Forum -

HTML writer to PDF

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


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);

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