I'm facing this error while attempting to convert a CSV file to HTML using GroupDocs. The code for converting csv to html I copied from groupdocs documentation.can somebody help me out.
Bellow is the code
let filePath = 'sampel/csvFile.csv'
let filecontent = `Name,Age,Email,Address
John Doe,30,john.doe@example.com,123 Main St
Jane Smith,25,jane.smith@example.com,456 Elm Ave
Michael Johnson,28,michael.johnson@example.com,789 Oak Rd
Emily Williams,32,emily.williams@example.com,101 Pine Lane`;
let fileApi = conversion_cloud.FileApi.fromKeys(clientId, clientSecret);
let uploaRequest = new conversion_cloud.UploadFileRequest(filePath,filecontent);
await fileApi.uploadFile(uploaRequest).then(async (result, err) => {
if (err) {
console.log("upload- ", err);
return res.status(500).send(false);
} else {
console.log(" document uploaded", result);
}
let loadOptions = new conversion_cloud.CsvLoadOptions();
loadOptions.separator = ",";
loadOptions.convertDateTimeData = true;
convertOptions = new conversion_cloud.HtmlConvertOptions();
convertOptions.fixedLayout = false;
convertOptions.usePdf = false;
let settings = new conversion_cloud.ConvertSettings();
settings.filePath = filePath;
settings.format = "html";
settings.loadOptions = loadOptions;
settings.convertOptions = convertOptions;
result = await convertApi.convertDocument(
new conversion_cloud.ConvertDocumentRequest(settings)
);
console.log("CSV file converted to HTML successfully.");
// console.log('Output HTML file:', outputFile);
return res.send({
data: result.toString(),
});
});
Bellow is the error that I m getting In coverted HTML
<p>This page uses frames, but your browser doesn't support them.</p>