🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / C# RMOS / xls to txt xlsx to txt

1-) C# RMOS - xls to txt xlsx to txt

 

using DevExpress.Spreadsheet;

using DevExpress.Pdf;

 

 

public void xlsToText(){

 DevExpress.XtraSpreadsheet.SpreadsheetControl control = new DevExpress.XtraSpreadsheet.SpreadsheetControl();

                        control.LoadDocument(neyi, DevExpress.Spreadsheet.DocumentFormat.Xlsx);

 

       IWorkbook workbook = control.Document;

       string path ="gecici.pdf";

       using (FileStream stream = new FileStream(path, FileMode.Create, FileAccess.ReadWrite))

         {

          workbook.ExportToPdf(stream);

         }

 

     string deger = ExtractTextFromPDF(path);

}

 

 public string ExtractTextFromPDF(string filePath)

        {

            string documentText = "";

            try

            {

                using (PdfDocumentProcessor documentProcessor = new PdfDocumentProcessor())

                {

                    documentProcessor.LoadDocument(filePath);

                    documentText = documentProcessor.Text;

                }

            }

            catch { }

            return documentText;

        }

 

 

1-) C# RMOS - excel to html text

 

 

private void button1_Click(object sender, EventArgs e)

        {

 

            Worksheet worksheet = spreadsheetControl1.ActiveWorksheet;

 

            HtmlDocumentExporterOptions options = new HtmlDocumentExporterOptions();

 

            // Specify the part of the document to be exported to HTML.

            options.SheetIndex = worksheet.Index;

            //options.Range = "B2:G7";

 

            // Export the active worksheet to a stream as HTML with the specified options.

            using (FileStream htmlStream = new FileStream("OutputWorksheet.html", FileMode.Create))

            {

                spreadsheetControl1.ExportToHtml(htmlStream, options);

            }

 

            System.Diagnostics.Process.Start("OutputWorksheet.html");

        }

 2021 Ocak 18 Pazartesi
 376