0
Hii Suraj Kumar I am not familiar with the c# and .net. actually, I need solution in Angular JS.
Can you please provide any solution or any hint related to this.
0
You can try using Document conversion service from LEADTOOLS, which provides the ability to convert image formats to different document formats (such as Excel).
You can create your own REST or Web service and use the DocumentConverter class at the server side.
You can find an online demo that uses the document conversion service here:
https://demo.leadtools.com/JavaScript/DocumentViewer/
When you open the online demo, open your image and then select the menu "File\Export" to save the image as Excel (xls) format.
Also, the following online link provides more details about the DocumentConverter Class
https://www.leadtools.com/help/leadtools/v19/dh/doxc/documentconverter.html
Note that you can convert the base64 string into byte[] using the Convert.FromBase64String method:
https://msdn.microsoft.com/en-us/library/system.convert.frombase64string(v=vs.110).aspx
Then create a file or memory stream object from the byte[] using the FileStream or MemoryStream class constructor, save the image into a temp file or memory, and then pass it to the DocumentConverter class.
The following .NET C# code converts image formats (JPEG, PNG, BMP, etc.) to Excel (xls) using the document converter class:
-
- using (DocumentConverter documentConverter = new DocumentConverter())
- {
- string OcrAdvantageRuntimeDir = @"c:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime";
- documentConverter.Options.EnableSvgConversion = true;
- documentConverter.Options.JobErrorMode = DocumentConverterJobErrorMode.Abort;
-
- using (var ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false))
- {
- var rasterCodecs = new RasterCodecs();
- var documentWriter = new DocumentWriter();
-
- ocrEngine.Startup(rasterCodecs, documentWriter, null, OcrAdvantageRuntimeDir);
- documentConverter.SetOcrEngineInstance(ocrEngine, true);
- documentConverter.Diagnostics.EnableTrace = true;
-
- var inFile = @"C:\Users\Public\Pictures\Master.JPG";
- var outFile = @"C:\Users\Public\Pictures\Master.xls";
-
- var format = DocumentFormat.Xls;
- var jobData = DocumentConverterJobs.CreateJobData(inFile, outFile, format);
- jobData.JobName = "conversion job";
-
- var job = documentConverter.Jobs.CreateJob(jobData);
- documentConverter.Jobs.RunJob(job);
-
- if (job.Status == DocumentConverterJobStatus.Success)
- {
- Console.WriteLine("Success");
- }
- else
- {
- Console.WriteLine("{0} Errors", job.Status);
-
- foreach (var error in job.Errors)
- {
- Console.WriteLine(" {0} at {1}: {2}", error.Operation, error.InputDocumentPageNumber, error.Error.Message);
- }
- }
- }
- }
-

0
You can try, implement and get idea from the following link
https://www.aspsnippets.com/Articles/Export-GridView-with-Images-from-database-to-Word-Excel-and-PDF-Formats.aspx