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

Free Support Forum - aspose.cloud

Replace text in HTML similar to Mail Merge MS Word document

Hi,

Is it possible to replace tags in a html file similar to the aspose word. Is there any option available in aspose html to find the tags and replace them?

@venkatesh2382

Yes, you can use the TemplateMerge API Methods of Aspose.HTML Cloud for the purpose. Please check sample C# code and documentstest_template_1.zip (525 Bytes) for your reference.

HtmlApi htmlApi = new HtmlApi(ClientId, ClientSecret, "https://api.aspose.cloud");
string templateName = "test_template_1.html";
string dataFile = "templ_merge_data_1.json";
var response = htmlApi.GetMergeHtmlTemplate(templateName,dataFile);
Console.WriteLine(response);
var fileStream = System.IO.File.Create("C:/Temp/TemplateMergeHtml.html");
response.ContentStream.CopyTo(fileStream);