Csv to html conversion using groupdocs

53 Views Asked by At

Can somebody help me out .I m converting csv to html using groupdocs. But In the converted html I m getting some html and inside that html in head section i m getting this

```

This page uses frames, but your browser doesn't support them.

```

Bellow is my code :

 try {
            
        let uploadRequest = new conversion_cloud.UploadFileRequest(filePath,fileContent);

            await fileApi.uploadFile(uploaRequest).then(async (result,err) => {
              if (err) {
                console.log( err);
                return res.send(false);
              } else {       
                console.log(" document has been uploaded" );
              }

              let loadOptions = new conversion_cloud.CsvLoadOptions();
              loadOptions.separator = ",";
              loadOptions.format = "csv";
              loadOptions.convertDateTimeData = true;
              loadOptions.convertNumericData = true;
              loadOptions.treatConsecutiveDelimitersAsOne = false;
              loadOptions.treatLeadingInnerWhitespaceAsDelimiter = false;
              loadOptions.treatQuotedExpressionsAsStrings = true;
              loadOptions.autoFontSubstitution = false;
              loadOptions.format = input.fromFormat;
              loadOptions.sheetName = "Sheet1";
            // loadOptions.defaultFont = 'Arial';
              loadOptions.hideWordTrackedChanges = true;


            let convertOptions = new conversion_cloud.HtmlConvertOptions();
            convertOptions.fixedLayout = false;
            convertOptions.fixedLayoutShowBorders = true;
        
              let settings = new conversion_cloud.ConvertSettings();
              settings.filePath = input.filePath;
              settings.format = "html";
              settings.loadOptions = loadOptions;
              settings.convertOptions = convertOptions;
         
              await convertApi.convertDocument(new conversion_cloud.ConvertDocumentRequest(settings)) .then((result) => {
                  console.log("Conversion successful!");
                  return res.send(result); 
                })
                .catch((error) => {
                  console.error("Conversion failed:", error);
                });
              //
            })
    }

if I m converting the docx file (replace CsvLoadOptions() with WordProcessingLoadOptions()) then i m getting correct html ,but not getting for csv file.

0

There are 0 best solutions below