Free Support Forum - aspose.com

Html to PDF stream issue

I am using Aspose.html to convert html template to pdf and it is converting fine and saving into directory with below code. But instead of to save pdf, i want it to return pdf stream or pdf bytes. so i can use this code as API and from frontend i can download the pdf. Please help at ealiest.


using (var document = new HTMLDocument(Server.MapPath("~/Template/temp.html")))
{

var options = new Aspose.Html.Saving.PdfSaveOptions();
// I don’t want to save pdf instead of that i want either pdf stream or pdf bytes. so i can return that output and use it on frond end side
Aspose.Html.Converters.Converter.ConvertHTML(document, options, Server.MapPath("~/localfolder/test.pdf"));
}

@narendra.negi,

Thanks for contacting support.

Can you please share source file along with generated result to further investigate this issue. Also please share which version of Aspose.HTML you are using on your end.